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

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

?? avc_binwr.c

?? 支持各種柵格圖像和矢量圖像讀取的庫
?? C
?? 第 1 頁 / 共 5 頁
字號:
 * will be reused and overwritten. * * Note: there could be a problem if 2 processes try to add an entry * at the exact same time... does Arc/Info do any locking on that file??? *  * Returns an integer value corresponding to the new table index (ARC####) * or -1 if something failed. **********************************************************************//* Prototype for _AVCBinReadNextArcDir() from avc_bin.c */int _AVCBinReadNextArcDir(AVCRawBinFile *psFile, AVCTableDef *psArcDir);int _AVCBinWriteCreateArcDirEntry(const char *pszArcDirFile,                                  AVCTableDef *psTableDef,                                   AVCDBCSInfo *psDBCSInfo){    int          iEntry, numDirEntries=0, nTableIndex = 0;    VSIStatBuf   sStatBuf;    AVCRawBinFile *hRawBinFile;    GBool        bFound;    AVCTableDef  sEntry;    /*-----------------------------------------------------------------     * Open and Scan the ARC.DIR to establish the table index (ARC####)     *----------------------------------------------------------------*/#ifdef _WIN32    /*-----------------------------------------------------------------     * Note, DM, 20010507 - We used to use VSIFStat() to establish the     * size of arc.dir, but when working on a WinNT4 networked drive, the     * stat() information was not always right, and we sometimes ended      * up overwriting arc.dir entries.  The solution: open and scan arc.dir     * until EOF to establish its size.       * That trick also seems to fix another network buffer problem: when      * writing a coverage in a new empty dir (with no info dir yet), we     * would get an error in fwrite() while writing the 3rd arc.dir      * entry of the coverage.  That second problem could also have been      * fixed by forcing a VSIFSeek() before the first fwrite()... we've      * added it below.     *----------------------------------------------------------------*/    FILE *fp;    if ((fp = VSIFOpen(pszArcDirFile, "r")) != NULL)    {        char buf[380];        while (!VSIFEof(fp))        {            if (VSIFRead(buf, 380, 1, fp) == 1)                numDirEntries++;        }        VSIFClose(fp);        hRawBinFile = AVCRawBinOpen(pszArcDirFile, "r+",                                    AVC_COVER_BYTE_ORDER(AVCCoverV7),                                    psDBCSInfo);    }    else #endif    /* On Unix we can still use fstat() */    if ( VSIStat(pszArcDirFile, &sStatBuf) != -1 )    {        numDirEntries = sStatBuf.st_size/380;        hRawBinFile = AVCRawBinOpen(pszArcDirFile, "r+",                                    AVC_COVER_BYTE_ORDER(AVCCoverV7),                                    psDBCSInfo);    }    else    {        numDirEntries = 0;        hRawBinFile = AVCRawBinOpen(pszArcDirFile, "w",                                     AVC_COVER_BYTE_ORDER(AVCCoverV7),                                     psDBCSInfo);    }    if (hRawBinFile == NULL)    {        /* Failed to open file... just return -1 since an error message         * has already been issued by AVCRawBinOpen()         */        return -1;    }    /* Init nTableIndex at -1 so that first table created should have      * index 0      */    nTableIndex = -1;    iEntry = 0;    bFound = FALSE;    while(!bFound && iEntry<numDirEntries &&          _AVCBinReadNextArcDir(hRawBinFile, &sEntry) == 0)    {        nTableIndex = atoi(sEntry.szInfoFile+3);        if (EQUALN(psTableDef->szTableName, sEntry.szTableName,                    strlen(psTableDef->szTableName)))        {               bFound = TRUE;            break;        }        iEntry++;    }    /*-----------------------------------------------------------------     * Reposition the file pointer and write the entry.     *     * We use VSIFSeek() directly since the AVCRawBin*() functions do     * not support random access yet... it is OK to do so here since the     * ARC.DIR does not have a header and we will close it right away.     *----------------------------------------------------------------*/    if (bFound)        VSIFSeek(hRawBinFile->fp, iEntry*380, SEEK_SET);    else    {        /* Not found... Use the next logical table index */        nTableIndex++;        /* We're already at EOF so we shouldn't need to fseek here, but         * ANSI-C requires that a file positioning function be called          * between read and writes... this had never been a problem before         * on any system except with NT4 network drives.         */        VSIFSeek(hRawBinFile->fp, numDirEntries*380, SEEK_SET);    }    sprintf(psTableDef->szInfoFile, "ARC%4.4d", nTableIndex);    _AVCBinWriteArcDir(hRawBinFile, psTableDef);    AVCRawBinClose(hRawBinFile);    return nTableIndex;}/********************************************************************** *                          AVCBinWriteCreateTable() * * Open an INFO table for writing: * *  - Add an entry for the new table in the info/arc.dir *  - Write the attributes definitions to the info/arc####.nit *  - Create the data file, ready to write data records to it *  - If necessary, set the arc####.dat to point to the location of *    the data file. * * pszInfoPath is the info directory path, terminated by a '/' or a '\\' * It is assumed that this 'info' directory already exists and is writable. * * psTableDef should contain a valid table definition for this coverage. * This function will create and maintain its own copy of the structure. * * The name of the file to create and its location will be based on the  * table name and the external ("XX") flag values in the psTableDef  * structure, so you have to make sure that these values are valid. * * If a table with the same name is already present in the arc.dir, then  * the same arc.dir entry will be used and overwritten.  This happens * when a coverage directory is deleted by hand.  The behavior implemented * here correspond to Arc/Info's behavior. * * For internal tables, the data file goes directly in the info directory, so * there is not much to worry about. * * For external tables, the table name is composed of 3 parts: * *         <COVERNAME>.<EXT><SUBCLASSNAME> * *  - <COVERNAME>: *    The first part of the table name (before the '.') is the *    name of the coverage to which the table belongs, and the data file *    will be created in this coverage's directory... so it is assumed that *    the directory "../<covername>" already exists and is writable. *  - <EXT>: *    The coverage name is followed by a 3 chars extension that will be  *    used to build the name of the external table to create. *  - <SUBCLASSNAME>: *    For some table types, the extension is followed by a subclass name. *     *  When <SUBCLASSNAME> is present, then the data file name will be: *            "../<covername>/<subclassname>.<ext>" * *    e.g. The table named "TEST.PATCOUNTY" would be stored in the file *         "../test/county.pat" (this path is realtive to the info directory) * *  When the <SUBCLASSNAME> is not present, then the name of the data file *  will be the "../<covername>/<ext>.adf" * *    e.g. The table named "TEST.PAT" would be stored in the file  *         "../test/pat.adf" * * Of course, it would be too easy if there were no exceptions to these * rules!  Single precision ".TIC" and ".BND" follow the above rules and * will be named "tic.adf" and "bnd.adf" but in double precision coverages, * they will be named "dbltic.adf" and "dblbnd.adf". * * Returns a valid AVCBinFile handle, or NULL if the table could * not be created. * * AVCBinClose() will eventually have to be called to release the  * resources used by the AVCBinFile structure. **********************************************************************/AVCBinFile *AVCBinWriteCreateTable(const char *pszInfoPath,                                    const char *pszCoverName,                                   AVCTableDef *psSrcTableDef,                                   AVCCoverType eCoverType,                                   int nPrecision, AVCDBCSInfo *psDBCSInfo){    AVCBinFile   *psFile;    AVCRawBinFile *hRawBinFile;    AVCTableDef  *psTableDef = NULL;    char         *pszFname = NULL, szInfoFile[8]="";    int          i, nTableIndex = 0;    if (eCoverType == AVCCoverPC || eCoverType == AVCCoverPC2)        return _AVCBinWriteCreateDBFTable(pszInfoPath, pszCoverName,                                          psSrcTableDef, eCoverType,                                           nPrecision, psDBCSInfo);    /*-----------------------------------------------------------------     * Make sure precision value is valid (AVC_DEFAULT_PREC is NOT valid)     *----------------------------------------------------------------*/    if (nPrecision!=AVC_SINGLE_PREC && nPrecision!=AVC_DOUBLE_PREC)    {        CPLError(CE_Failure, CPLE_IllegalArg,                 "AVCBinWriteCreateTable(): Invalid precision parameter "                 "(value must be AVC_SINGLE_PREC or AVC_DOUBLE_PREC)");        return NULL;    }    /* Alloc a buffer big enough for the longest possible filename...     */    pszFname = (char*)CPLMalloc((strlen(pszInfoPath)+81)*sizeof(char));    /*-----------------------------------------------------------------     * Alloc and init the AVCBinFile struct.     *----------------------------------------------------------------*/    psFile = (AVCBinFile*)CPLCalloc(1, sizeof(AVCBinFile));    psFile->eFileType = AVCFileTABLE;    /* Precision is not important for tables */    psFile->nPrecision = nPrecision;    psFile->eCoverType = eCoverType;    psFile->hdr.psTableDef = psTableDef = _AVCDupTableDef(psSrcTableDef);    /*-----------------------------------------------------------------     * Add a record for this table in the "arc.dir"     * Note: there could be a problem if 2 processes try to add an entry     * at the exact same time... does Arc/Info do any locking on that file???     *----------------------------------------------------------------*/    sprintf(pszFname, "%sarc.dir", pszInfoPath);    nTableIndex = _AVCBinWriteCreateArcDirEntry(pszFname, psTableDef,                                                 psDBCSInfo);    if (nTableIndex < 0)    {        /* Failed to add arc.dir entry... just return NULL since an error         * message has already been issued by _AVCBinWriteCreateArcDirEntry()         */        _AVCDestroyTableDef(psTableDef);        CPLFree(psFile);        CPLFree(pszFname);        return NULL;    }    sprintf(szInfoFile, "arc%4.4d", nTableIndex);    /*-----------------------------------------------------------------     * Create the "arc####.nit" with the attribute definitions.     *----------------------------------------------------------------*/    sprintf(pszFname, "%s%s.nit", pszInfoPath, szInfoFile);    hRawBinFile = AVCRawBinOpen(pszFname, "w",                                AVC_COVER_BYTE_ORDER(AVCCoverV7),                                psDBCSInfo);    if (hRawBinFile == NULL)    {        /* Failed to open file... just return NULL since an error message         * has already been issued by AVCRawBinOpen()         */        _AVCDestroyTableDef(psTableDef);        CPLFree(psFile);        CPLFree(pszFname);        return NULL;    }    for(i=0; i<psTableDef->numFields; i++)    {        _AVCBinWriteArcNit(hRawBinFile, &(psTableDef->pasFieldDef[i]));    }    AVCRawBinClose(hRawBinFile);    hRawBinFile = NULL;    /*-----------------------------------------------------------------     * The location of the data file depends on the external flag.     *----------------------------------------------------------------*/    if (EQUAL(psTableDef->szExternal, "  "))    {        /*-------------------------------------------------------------         * Internal table: data goes directly in "arc####.dat"         *------------------------------------------------------------*/        psTableDef->szDataFile[0] = '\0';        sprintf(pszFname, "%s%s.dat", pszInfoPath, szInfoFile);        psFile->pszFilename = CPLStrdup(pszFname);    }    else    {        /*-------------------------------------------------------------         * External table: data stored in the coverage directory, and         * the path to the data file is written to "arc####.dat"         *... start by extracting the info to build the data file name...         *------------------------------------------------------------*/        char szCoverName[40]="", szExt[4]="", szSubclass[40]="", *pszPtr;        int nLen;        FILE *fpOut;        nLen = strlen(psTableDef->szTableName);        CPLAssert(nLen <= 32);        if (nLen > 32) return NULL;        pszPtr = psTableDef->szTableName;        for(i=0; *pszPtr!='\0' && *pszPtr!='.' && *pszPtr!=' ';  i++, pszPtr++)        {            szCoverName[i] = tolower(*pszPtr);        }        szCoverName[i] = '\0';        if (*pszPtr == '.')            pszPtr++;        for(i=0; i<3 && *pszPtr!='\0' && *pszPtr!=' ';  i++, pszPtr++)        {            szExt[i] = tolower(*pszPtr);        }        szExt[i] = '\0';        for(i=0; *pszPtr!='\0' && *pszPtr!=' ';  i++, pszPtr++)        {            szSubclass[i] = tolower(*pszPtr);        }        szSubclass[i] = '\0';        /*-------------------------------------------------------------         * ... and build the data file name based on what we extracted         *------------------------------------------------------------*/        if (strlen(szSubclass) == 0)        {            if (nPrecision == AVC_DOUBLE_PREC &&                (EQUAL(szExt, "TIC") || EQUAL(szExt, "BND")) )            {                /* "../<covername>/dbl<ext>.adf" */                sprintf(psTableDef->szDataFile,                         "../%s/dbl%s.adf", szCoverName, szExt);            }            else            {                /* "../<covername>/<ext>.adf" */                sprintf(psTableDef->szDataFile,                         "../%s/%s.adf", szCoverName, szExt);            }  

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产在线视频不卡二| 麻豆精品视频在线| 亚洲午夜日本在线观看| 日韩国产欧美三级| 成人精品鲁一区一区二区| 成人av电影在线| 5566中文字幕一区二区电影| 久久久久综合网| 午夜精品影院在线观看| 国产精品888| 欧美三级电影在线观看| 国产精品视频一区二区三区不卡| 亚洲精品免费在线播放| 国产在线精品一区二区不卡了 | 久久这里只有精品视频网| 亚洲欧洲日韩女同| 午夜电影网亚洲视频| 99国产精品久| 日本一二三不卡| 久久爱www久久做| 日韩欧美国产不卡| 亚洲成人福利片| 91精品办公室少妇高潮对白| 国产亚洲欧美在线| 国产91丝袜在线播放| 精品91自产拍在线观看一区| 秋霞午夜av一区二区三区| 欧美在线视频不卡| 亚洲aⅴ怡春院| 欧美色图免费看| 午夜一区二区三区在线观看| 欧美最新大片在线看 | 成人永久免费视频| 国产午夜精品福利| 成人短视频下载| 亚洲人成精品久久久久| 欧美亚洲图片小说| 蜜桃传媒麻豆第一区在线观看| 91麻豆精品国产自产在线观看一区| 首页亚洲欧美制服丝腿| 欧美电影免费观看高清完整版在线观看| 精品视频123区在线观看| 亚洲成a人片综合在线| 日韩欧美美女一区二区三区| 国产精品中文字幕一区二区三区| 国产精品美女一区二区在线观看| 91麻豆免费在线观看| 午夜精品123| 国产日韩欧美高清在线| 91香蕉国产在线观看软件| 三级欧美在线一区| 丝袜亚洲另类欧美综合| 久久综合五月天婷婷伊人| 成人福利在线看| 日日摸夜夜添夜夜添国产精品| 精品美女在线观看| 在线观看亚洲精品视频| 国产69精品久久99不卡| 美女在线观看视频一区二区| 中文字幕一区日韩精品欧美| 日韩欧美一区二区三区在线| 91亚洲精品乱码久久久久久蜜桃| 日本麻豆一区二区三区视频| 一区二区三区在线视频观看| 久久亚洲精精品中文字幕早川悠里| 色综合天天综合狠狠| 国产白丝精品91爽爽久久| 免费观看久久久4p| 日韩avvvv在线播放| 一区二区日韩电影| 亚洲一区免费在线观看| 亚洲激情成人在线| 亚洲精品日产精品乱码不卡| 国产精品不卡一区| 国产精品无遮挡| **欧美大码日韩| 国产精品视频一二三区| 亚洲欧美在线高清| 一区二区三区自拍| 天天色综合天天| 久久国产尿小便嘘嘘| 免费在线观看日韩欧美| 喷白浆一区二区| 国产精品一区二区男女羞羞无遮挡 | 亚洲人成伊人成综合网小说| 国产精品护士白丝一区av| 亚洲人成7777| 麻豆91在线播放| 成人av电影在线| 欧美电影免费观看高清完整版 | 国产成人在线看| 91久久精品一区二区三区| 欧美日韩不卡在线| 久久影院午夜片一区| 亚洲精品国久久99热| 青青国产91久久久久久| 懂色av一区二区夜夜嗨| 欧美网站大全在线观看| 久久看人人爽人人| 亚洲国产精品自拍| 丁香一区二区三区| 欧美精品在线一区二区| 亚洲欧美综合色| 国产一区二区三区免费播放 | 一色屋精品亚洲香蕉网站| 天天色图综合网| 91丨porny丨户外露出| 国产欧美日韩久久| 久热成人在线视频| 欧美色网一区二区| 亚洲视频电影在线| 国产成人av电影在线观看| 日韩精品一区二区在线观看| 亚洲人精品午夜| 97aⅴ精品视频一二三区| 久久久久久久综合色一本| 蜜桃精品在线观看| 91精品国产色综合久久ai换脸| 亚洲欧美一区二区三区国产精品| 成人午夜私人影院| 日本一区二区三区久久久久久久久不| 日韩电影在线一区| 日韩精品资源二区在线| 免费精品99久久国产综合精品| 日本女优在线视频一区二区| 91女厕偷拍女厕偷拍高清| 日本系列欧美系列| 亚洲成人免费视频| 国产成人免费av在线| 国产一区 二区 三区一级| 亚洲欧美精品午睡沙发| 日韩欧美一区二区在线视频| 成人ar影院免费观看视频| 奇米色一区二区三区四区| 亚洲猫色日本管| 中文字幕日韩精品一区| 日韩精品在线看片z| 91麻豆精品国产91久久久 | 黄色精品一二区| 中日韩免费视频中文字幕| 91在线porny国产在线看| 免费成人在线观看视频| 国产日韩欧美精品一区| 欧美在线一二三| 国产精品一品二品| 性做久久久久久久久| 国产精品乱人伦| 宅男在线国产精品| 一本大道综合伊人精品热热| 麻豆精品视频在线| 一区二区三区中文在线观看| 日韩欧美国产精品| 欧美日韩一区在线观看| 国产在线精品一区在线观看麻豆| 亚洲一区二区中文在线| 中文字幕一区二区在线播放 | 国产一区二区伦理| 日韩电影在线观看一区| 亚洲码国产岛国毛片在线| 国产精品欧美久久久久无广告| 精品日韩av一区二区| 日韩三区在线观看| 日韩美女视频在线| 日韩精品中文字幕在线不卡尤物| 欧美视频一二三区| 欧美亚洲免费在线一区| 欧洲精品一区二区三区在线观看| a亚洲天堂av| 欧美亚洲禁片免费| 91精品国产综合久久精品| 91麻豆精品国产自产在线 | 久久美女高清视频| 国产一区二区三区日韩| 国产91精品一区二区麻豆亚洲| 欧美女孩性生活视频| 欧美片网站yy| 国产拍揄自揄精品视频麻豆| 丝袜美腿亚洲一区| 欧美日韩大陆一区二区| 亚洲摸摸操操av| 91免费版在线| 亚洲欧洲日韩女同| 色呦呦一区二区三区| 国产精品色眯眯| 99re66热这里只有精品3直播| 亚洲少妇中出一区| 欧美视频在线一区二区三区| 亚洲国产视频在线| 精品久久人人做人人爰| 国产91精品久久久久久久网曝门| 国产婷婷色一区二区三区| 成人精品视频一区二区三区尤物| 国产欧美日韩另类视频免费观看| 91亚洲永久精品| 亚洲成人av在线电影| 337p粉嫩大胆噜噜噜噜噜91av| 丰满岳乱妇一区二区三区| 亚洲欧美激情视频在线观看一区二区三区| 在线观看91精品国产入口| 日本成人在线网站|