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

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

?? dosvdirlib.c

?? vxworks操作系統的文件系統部分原代碼
?? C
?? 第 1 頁 / 共 5 頁
字號:
/* dosVDirLib.c - MS-DOS VFAT-style Long File names dir handler */ /* Copyright 1999-2002 Wind River Systems, Inc. *//*modification history--------------------01p,10dec01,jkf  SPR#72039, various fixes from Mr. T. Johnson.01o,09nov01,jkf  SPR#70968, chkdsk destroys boot sector01n,21aug01,jkf  SPR#69031, common code for both AE & 5.x.01m,06mar01,jkf  SPR#34704, rootNSec calculation must round up.01n,01aug00,dat  SPR 31480, directory cluster corruption fix (neeraj)01l,07mar00,jkf  Corrected pentium specific compiler warning "using %eax                  instead of %ax due to l" (source of P6 reg stall?)01k,29feb00,jkf  T3 changes, cleanup. 01j,31aug99,jkf  changes for new CBIO API.01i,31jul99,jkf  moved the fix for SPR#28276 from dosVDirFileCreateInDir()                  to dosVDirNameEncodeShort because it was only mangling the                  name in 01g and not creating an alias for it, no SPR.01h,31jul99,jkf  default debug global to zero, no SPR.01g,31jul99,jkf  Fixed dosVDirFileCreateInDir to mangle 8.3 names containing                  char-space-char, per MS compatability.  MS Scandisk and 		 Norton Disk Doctor stops reporting a false orphaned LFN 		 which they repair by removing it.  SPR#2827601f,31jul99,jkf  T2 merge, tidiness & spelling.01e,07dec98,lrn  minor Show output cosmetics01d,22nov98,vld  all offsets of directory entry changed to be		 counted in absolute offset from parent directory		 start01c,28sep98,vld  gnu extensions dropped from DBG_MSG/ERR_MSG macros01b,02jul98,lrn  review doc01a,18jan98,vld  written,*//*DESCRIPTIONThis library is part of dosFsLib and is designed to handle theVFAT "long filename" standard disk directory structure.VFAT is the file name format initially introduced with OS/2 operatingsystem, and subsequently adopted by Microsoft in Windows 95 and NToperating systems for FAT-based file systems.With this format, every file has a Long Name which occupies a number ofdirectory entries, and a short file name which adheres to the vintageMS-DOS file naming conventions. The later are called aliases.This handler performs its lookup only by file long names, not by aliases,in other words, the aliases, are provided only for data interchange withMicrosoft implementations of FAT, and are ignored otherwise.Aliases, that are created for long file names are Windows95/98 compatible,that means, they are readable from Windows applications, but they arenot produced from the corresponding long file name.In this implementation the alias is made of numbers to ensure thatevery alias is unique in its directory without having to scan the entiredirectory.  This ensure determinism.Therefore if a volume written with this handler is every transported toan old MS-DOS system or comparable implementation of dosFs,which only accepts vintage 8.3 file names, the names of files will notbe readily associated with their original names, and thus practicallyunusable. The goal was to ensure determinism and file safety.Uppercase 8.3 filename that follow strict 8.3 rules such as "UPPERFIL.TXT" will not be stored in a long filename.  Lowercase 8.3 Filenames such as "Upperfil.txt" will have a readablealias created of "UPPERFIL.TXT"   Lowercase 8.3 Filenames such as "File   " will have an alias created of "FILE    ".Filenames with a sequence of char, space, char strings. Such as "3D Pipes.scr" will also have a munged alias created akin to "3~999997".The routine dosVDirInit() routine has to be called once to install this handler into dosFsLib. Once that has been done this directoryhandler will be automatically mounted for each new DOS volume being mounted and containing VFAT or early DOS directory structure.SEE ALSO:dosFsLib.*//* includes */#include "vxWorks.h"#include "private/dosFsVerP.h"#include "stat.h"#include "dirent.h"#include "time.h"#include "stdio.h"#include "ctype.h"#include "taskLib.h"#include "stdlib.h"#include "string.h"#include "semLib.h"#include "logLib.h"#include "errnoLib.h"#include "time.h"#include "utime.h"#include "memLib.h"#include "private/dosFsLibP.h"#include "private/dosDirLibP.h"/* defines */#undef DBG_PRN_STR#undef DBG_MSG#undef ERR_MSG#undef NDEBUG #ifdef DEBUG#   undef LOCAL#   define LOCAL#   undef ERR_SET_SELF#   define ERR_SET_SELF#   define DBG_PRN_STR( lvl, fmt, pStr, len, arg )		\	{ if( (lvl) <= dosVDirDebug )		{		\	    char cBuf = ((char *)(pStr))[len];			\	    (pStr)[len] = EOS; 					\	    printErr( (fmt),(pStr),(arg) );			\	    ((char *)(pStr))[len] = cBuf; 	} }#   define DBG_MSG( lvl, fmt, arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8 )	\	{ if( (lvl) <= dosVDirDebug )					\	    printErr( "%s : %d : " fmt,				\	               __FILE__, __LINE__, arg1,arg2,	\		       arg3,arg4,arg5,arg6,arg7,arg8 ); }#   define ERR_MSG( lvl, fmt, a1,a2,a3,a4,a5,a6 )		\        { logMsg( __FILE__ " : " fmt, (int)(a1), (int)(a2),	\		  (int)(a3), (int)(a4), (int)(a5), (int)(a6) ); }#else	/* NO DEBUG */#   define NDEBUG#   define DBG_PRN_STR( lvl, fmt, pStr, len, arg )	{}#   define DBG_MSG(lvl,fmt,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) 	{}#   define ERR_MSG( lvl, fmt, a1,a2,a3,a4,a5,a6 )		\	{ if( (lvl) <= dosVDirDebug ) 				\            logMsg( __FILE__ " : " fmt, (int)(a1), (int)(a2),	\		  (int)(a3), (int)(a4), (int)(a5), (int)(a6) ); }#endif /* DEBUG */ #include "assert.h"#ifdef ERR_SET_SELF#   define errnoSet( err ) errnoSetOut( __FILE__, __LINE__, #err, (err) )#endif /* ERR_SET_SELF */#define VFAT_MAX_ENT	( (DOS_VFAT_NAME_LEN + CHAR_PER_VENTRY - 1) \			  / CHAR_PER_VENTRY )					/* max directory entries required */					/* to store VFAT long name */#define MAX_VFAT_FULL_DIRENT	( DOS_DIRENT_STD_LEN * (VFAT_MAX_ENT + 1) )					/* max space of long name + alias */					/* may occupy on disk */#define CHAR_PER_VENTRY		13	/* num of characters of long name */					/* encoded within directory entry */#define VFAT_ENTNUM_MASK	0x1f	/* mask of "entry number within */					/* long name" field */ #define DOS_VFAT_CHKSUM_OFF	13#define DOS_ATTR_VFAT		0x0f	/* value of attribute field for */					/* directory entries, that encodes */					/* VFAT long name *//* special characters */#define DOS_VLAST_ENTRY	0x40	/* last entry in long name representation *//* special function argument value */#define DH_ALLOC	(1<<7)	/* add cluster to directory chain */#define PUT_CURRENT	(1<<0)	/* store currently pointed directory entry */#define	PUT_NEXT	(1<<1)	/* store next directory entry *//* macros *//* typedefs */typedef enum {RD_FIRST, RD_CURRENT, RD_NEXT, FD_ENTRY} RDE_OPTION;				/* function argument */typedef enum {STRICT_SHORT, NOT_STRICT_SHORT, NO_SHORT} SHORT_ENCODE;				/* function argument */typedef struct DOS_VDIR_DESCR	/* directory handler's part of */				/* volume descriptor */    {    DOS_DIR_PDESCR	genDirDesc;	/* generic descriptor */    } DOS_VDIR_DESCR;typedef DOS_VDIR_DESCR *	DOS_VDIR_DESCR_ID;/* globals */unsigned int	dosVDirDebug = 0;/* locals *//* positions of filename characters encoding within VFAT directory entry */LOCAL const u_char	chOffsets[] = { 1, 3, 5, 7, 9,					14, 16, 18, 20, 22, 24, 						28, 30 };/* valid filename characters table ('|' is invalid character) */static const u_char	shortNamesChar[] =                                        /* 0123456789abcdef */                                          "||||||||||||||||"                                          "||||||||||||||||"                                          " !|#$%&'()|||-||"                                          "0123456789||||||"                                          "@ABCDEFGHIJKLMNO"                                          "PQRSTUVWXYZ|||^_"                                          "`ABCDEFGHIJKLMNO"                                          "PQRSTUVWXYZ{|}~|" ,                        longNamesChar[] =                                        /* 0123456789abcdef */                                          "||||||||||||||||"                                          "||||||||||||||||"                                          " !|#$%&'()|+,-.|"                                          "0123456789|;|=||"                                          "@ABCDEFGHIJKLMNO"                                          "PQRSTUVWXYZ[|]^_"                                          "`abcdefghijklmno"                                          "pqrstuvwxyz{|}~|" ;#ifdef ERR_SET_SELF/******************************************************************************** errnoSetOut - put error message** This routine is called instead errnoSet during debugging.*/static VOID errnoSetOut(char * file, int line, const char * str, int errCode )    {    if( errCode != OK  && strcmp( str, "errnoBuf" ) != 0 )        printf( " %s : line %d : %s = %p, task %p\n",                file, line, str, (void *)errCode,                (void *)taskIdSelf() );    errno = errCode;    }#endif  /* ERR_SET_SELF *//***************************************************************************** dosVDirFillFd - fill file descriptor for directory entry.** RETURNS: N/A.*/LOCAL void dosVDirFillFd    (    DOS_FILE_DESC_ID	pFd,	/* dos file descriptor to fill */    u_char *	pDirEnt,	/* directory entry from disk */    DIRENT_PTR_ID	pLnPtr	/* start of long name */    )    {    DOS_DIR_PDESCR_ID	pDirDesc = (void *)pFd->pVolDesc->pDirDesc;    DOS_DIR_HDL_ID	pDirHdl = (void *)&(pFd->pFileHdl->dirHdl);    DIRENT_DESCR_ID	pDeDesc;        pDeDesc = &pDirDesc->deDesc;        if( pDirEnt == NULL )	/* root directory */    	{    	DBG_MSG( 600, "root directory\n", 0,0,0,0,0,0,0,0 );    	ROOT_SET( pFd );	/* via <parDirStartCluster> field */    	pFd->curSec = pDirDesc->dirDesc.rootStartSec;    	pFd->nSec = pDirDesc->dirDesc.rootNSec;    	pFd->pos = 0;    	pFd->pFileHdl->attrib = DOS_ATTR_DIRECTORY;    	pFd->pFileHdl->startClust = pDirDesc->rootStartClust;    	    	pDirHdl->sector = NONE;    	pDirHdl->offset = NONE;    	pDirHdl->lnSector = 0;    	pDirHdl->lnOffset = 0;    	    	pFd->cbioCookie = (cookie_t) NULL;    	pDirHdl->cookie = (cookie_t) NULL;    	    	goto rewind;    	}        /* at the beginning fill directory handle using file descriptor */        pDirHdl->parDirStartCluster = pFd->pFileHdl->startClust;    pDirHdl->sector = pFd->curSec;    pDirHdl->offset = pFd->pos;    pDirHdl->cookie = pFd->cbioCookie;        /* long name ptr */        if( pLnPtr != NULL )    	{    	pDirHdl->lnSector = pLnPtr->sector;    	pDirHdl->lnOffset = pLnPtr->offset;    	}    else	/* just a short name */    	{    	pDirHdl->lnSector = 0;    	pDirHdl->lnOffset = 0;    	}    pFd->cbioCookie = (cookie_t) NULL;    /* disassemble directory entry */        pFd->pos = 0;        pFd->curSec = 0;    pFd->nSec = 0;        pFd->pFileHdl->attrib = *(pDirEnt + pDeDesc->atrribOff);    pFd->pFileHdl->startClust =    		START_CLUST_DECODE( pFd->pVolDesc, pDeDesc, pDirEnt );        pFd->pFileHdl->size = DISK_TO_VX_32(pDirEnt + pDeDesc->sizeOff);    if( pDeDesc->extSizeOff != (u_char) NONE )    	{    	pFd->pFileHdl->size += EXT_SIZE_DECODE( pDeDesc, pDirEnt );    	}    DBG_MSG( 100, "StartCluster = %u = %p, size = %lu\n",    		pFd->pFileHdl->startClust, (void *)pFd->pFileHdl->startClust,    		(u_long)pFd->pFileHdl->size & 0xffffffff ,0,0,0,0,0);        rewind:    DBG_MSG( 600, "pFd = %p "    		  "dir hdl (sec-of-par = %u sector = %u offset = %u)\n"                  "pFileHdl = %p "                  "(startClust = %u size = %lu attr = %p)\n",                  pFd, pDirHdl->parDirStartCluster,                  pDirHdl->sector, pDirHdl->offset,                  pFd->pFileHdl, pFd->pFileHdl->startClust,                  pFd->pFileHdl->size,                  (void *)((int)pFd->pFileHdl->attrib) );    /*     * cause FAT to start from start cluster and     * get start contiguous block     */    bzero( (char *)&pFd->fatHdl, sizeof( pFd->fatHdl ) );    return;    } /* dosVDirFillFd() *//***************************************************************************** dosVDirRewindDir - rewind directory pointed by <pFd>.** This routine sets current sector in pFd to directory start sector* and current position  (offset in sector) to 0.* * RETURNS: N/A.*/LOCAL void dosVDirRewindDir    (    DOS_FILE_DESC_ID	pFd	/* dos file descriptor to fill */    )    {    DOS_DIR_PDESCR_ID	pDirDesc = (void *)pFd->pVolDesc->pDirDesc;        pFd->pos = 0;    pFd->nSec = 0;    pFd->curSec = 0;        /* for FAT32 curSec = rootNSec = 0 */        if( IS_ROOT( pFd ) && pDirDesc->dirDesc.rootNSec != 0 )    	{    	pFd->curSec = pDirDesc->dirDesc.rootStartSec;    	pFd->nSec = pDirDesc->dirDesc.rootNSec;    	return;    	}        /* regular file or FAT32 root */    /*     * cause FAT to start from start cluster and     * get start contiguous block     */    if( pFd->pVolDesc->pFatDesc->seek( pFd, FH_FILE_START, 0 ) == ERROR )    	{    	assert( FALSE );    	}    } /* dosVDirRewindDir() */   /***************************************************************************** dosVDirPathParse - parse a full pathname into an array of names.** This routine is similar to pathParse(), but on the contrary it does not * allocate additional buffers nor changes the path string.** Parses a path in directory tree which has directory names* separated by '/' or '\'s.  It fills the supplied array of* structures with pointers to directory and file names and * correspondence name length.* All occurrences of '//', '.' and '..'* are right removed from path. All tail dots and spaces are broken from* each name, that is name like "abc. . ." is treated as just "abc".** For instance, "/usr/vw/data/../dir/file" gets parsed into** .CS*                          namePtrArray*                         |---------|*   ---------------------------o    |*   |                     |    3    |*   |                     |---------|*   |   -----------------------o    |*   |   |                 |    2    |*   |   |                 |---------|*   |   |          ------------o    |*   |   |          |      |    3    |*   |   |          |      |---------|*   |   |          |   --------o    |*   |   |          |   |  |    4    |*   |   |          |   |  |---------|*   v   v          v   v  |   NULL  |*   |   |          |   |  |    0    |*   |   |          |   |  |---------|*   v   v          v   v *  |------------------------|*  |usr/vw/data/../dir/file |*  |-------\-----/----------|*          ignored* .CE

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产福利一区二区三区| 欧美日韩一级片网站| 欧美日韩国产一二三| 日本 国产 欧美色综合| 国产亚洲视频系列| 日本高清不卡视频| 另类专区欧美蜜桃臀第一页| 国产三级三级三级精品8ⅰ区| 日日夜夜一区二区| 日韩亚洲欧美综合| 波多野结衣中文一区| 五月天一区二区| 久久久激情视频| 欧美日韩综合在线| 欧美日韩和欧美的一区二区| 欧美日韩中文另类| 91精品国产丝袜白色高跟鞋| 91免费观看视频| 国精品**一区二区三区在线蜜桃| 中文字幕一区二区三区在线观看 | 一区在线播放视频| 日韩毛片精品高清免费| 91精品国产aⅴ一区二区| 日韩一级黄色片| 2021久久国产精品不只是精品| 欧美日韩综合一区| 日韩亚洲欧美成人一区| 久久久久国产精品人| 中文字幕av一区 二区| 日韩精品最新网址| 欧美日韩国产bt| 日韩一区二区三| 欧美激情一区在线观看| 成人欧美一区二区三区小说| 亚洲精品视频一区| 亚洲欧洲av一区二区三区久久| 亚洲精选在线视频| 看国产成人h片视频| 成人精品免费网站| 成人免费黄色在线| 欧美日韩亚洲综合| 久久婷婷国产综合国色天香| 中文字幕在线免费不卡| 视频一区在线播放| 成人免费视频app| 在线播放中文一区| 欧美久久久一区| 久久综合狠狠综合久久综合88| 国产精品入口麻豆原神| 中文字幕制服丝袜一区二区三区| 中文在线资源观看网站视频免费不卡| 亚洲午夜国产一区99re久久| 亚洲一级在线观看| 性做久久久久久免费观看欧美| 一区二区三区四区激情| 亚洲韩国精品一区| 成人免费黄色大片| 精品免费一区二区三区| 久久精品亚洲一区二区三区浴池| 亚洲一区在线观看免费| 国产不卡在线一区| 在线视频欧美区| 欧美精品1区2区3区| 亚洲国产精品成人综合| 国产最新精品免费| 3d成人h动漫网站入口| 成人黄页毛片网站| 久久久久亚洲综合| 久久精品国产99| 91麻豆精品国产自产在线观看一区| 亚洲欧美中日韩| 丁香婷婷深情五月亚洲| 久久你懂得1024| 精品一区二区免费看| 国产ts人妖一区二区| 欧美mv日韩mv国产网站app| 婷婷开心激情综合| 欧美日韩一区二区三区四区 | 欧美中文字幕亚洲一区二区va在线 | 色哟哟精品一区| 555www色欧美视频| 天天av天天翘天天综合网色鬼国产 | 亚洲手机成人高清视频| 豆国产96在线|亚洲| 欧美激情中文字幕一区二区| 国产v综合v亚洲欧| 国产精品久久久久aaaa| 成人免费视频一区| 亚洲精品精品亚洲| 欧美性三三影院| 中文字幕欧美激情一区| www.欧美色图| 精品成人a区在线观看| 亚洲综合自拍偷拍| 欧美精品123区| 狠狠色综合日日| 国产精品欧美一区二区三区| 99久久精品一区| 久久精品亚洲麻豆av一区二区| 国产91精品一区二区麻豆亚洲| 国产精品美女久久久久久| 在线亚洲+欧美+日本专区| 亚洲国产美国国产综合一区二区| 这里只有精品99re| 黑人巨大精品欧美黑白配亚洲| 国产亚洲精品福利| 色视频一区二区| 蜜桃传媒麻豆第一区在线观看| 91国偷自产一区二区三区观看| 亚洲h动漫在线| 久久久久高清精品| 色94色欧美sute亚洲13| 日av在线不卡| 亚洲天天做日日做天天谢日日欢| 欧洲激情一区二区| 黄一区二区三区| 最好看的中文字幕久久| 日韩亚洲欧美一区| 色综合久久天天| 国精产品一区一区三区mba视频| 自拍av一区二区三区| 日韩欧美国产三级| 97se亚洲国产综合在线| 蜜桃视频在线观看一区| 亚洲黄网站在线观看| 久久日韩粉嫩一区二区三区 | 亚洲午夜电影网| 久久久久久久精| 欧美日韩亚洲另类| av一区二区三区黑人| 久久国产精品99精品国产| 亚洲精品乱码久久久久久| 久久综合九色综合欧美就去吻 | 美女任你摸久久| 亚洲精品欧美激情| 国产精品乱子久久久久| 欧美精品一区二区三区蜜桃| 国产精品剧情在线亚洲| 欧美性大战久久久久久久| 波多野结衣91| 国产精品一区二区久久精品爱涩| 69堂国产成人免费视频| 99精品黄色片免费大全| 国产精品一级片| 精品一二三四区| 久久99精品国产.久久久久久 | 在线免费一区三区| 成人综合激情网| 国产高清精品在线| 国产精品一二三四五| 国产综合色产在线精品| 国内精品免费**视频| 麻豆91在线播放| 久久黄色级2电影| 免费一级片91| 免费人成在线不卡| 蜜桃av一区二区在线观看| 日本中文字幕一区二区视频 | 一本大道久久a久久精二百| 成人av在线播放网址| 国产99一区视频免费| 欧洲另类一二三四区| 色综合色综合色综合| 色综合激情久久| 在线日韩一区二区| 欧美日产国产精品| 在线不卡欧美精品一区二区三区| 337p亚洲精品色噜噜| 日韩精品一区二区在线| 久久精品亚洲乱码伦伦中文| 国产精品国产三级国产a| 亚洲欧美欧美一区二区三区| 日韩欧美精品在线| 精品成a人在线观看| 国产精品高潮呻吟| 亚洲精品欧美激情| 免费高清视频精品| 丰满亚洲少妇av| 欧美视频中文字幕| 日韩欧美国产综合在线一区二区三区| 精品国产凹凸成av人导航| 久久久久久免费网| 亚洲黄网站在线观看| 久草在线在线精品观看| 国产成人av一区二区| 欧美亚洲日本一区| 26uuu另类欧美| 亚洲欧美成aⅴ人在线观看| 首页综合国产亚洲丝袜| 国产成人免费视频网站| 欧美人牲a欧美精品| 国产女人aaa级久久久级| 亚洲精品欧美在线| 国内外成人在线| 在线观看成人小视频| 久久亚洲一区二区三区明星换脸| 亚洲色图第一区| 激情综合色综合久久综合| 91久久精品国产91性色tv| 精品sm捆绑视频|