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

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

?? ucos.c

?? 在VC6環(huán)境下開發(fā)
?? C
字號(hào):
/*
** This file contains code that is specific to particular operating
** systems.  The purpose of this file is to provide a uniform abstraction
** on which the rest of eDb can operate.
*/

#include "eDbInit.h"
/*
** Macros for performance tracing.  Normally turned off
*/
#define TIMER_START
#define TIMER_END
#define SEEK(X)
#define TRACE1(X)
#define TRACE2(X,Y)
#define TRACE3(X,Y,Z)
#define TRACE4(X,Y,Z,A)
#define TRACE5(X,Y,Z,A,B)

/*
** If we compile with the eDb_TEST macro set, then the following block
** of code will give us the ability to simulate a disk I/O error.  This
** is used for testing the I/O recovery logic.
*/
#ifdef eDb_TEST
int eDb_io_error_pending = 0;
#define SimulateIOError(A)  \
   if( eDb_io_error_pending ) \
     if( eDb_io_error_pending-- == 1 ){ local_ioerr(); return A; }
static void local_ioerr(){
  eDb_io_error_pending = 0;  /* Really just a place to set a breakpoint */
}
#else
#define SimulateIOError(A)
#endif

/*
** When testing, keep a count of the number of open files.
*/
#ifdef eDb_TEST
int eDb_open_file_count = 0;
#define OpenCounter(X)  eDb_open_file_count+=(X)
#else
#define OpenCounter(X)
#endif


/*
** Delete the named file
*/
int eDbOsDelete(const char *zFilename){
	DeleteFile((char *)zFilename);
	return eDb_OK;
}

/*
** Return TRUE if the named file exists.
*/
int eDbOsFileExists(const char *zFilename){
	return FileExist((char *)zFilename);
}

/*
** Attempt to open a file for both reading and writing.  If that
** fails, try opening it read-only.  If the file does not exist,
** try to create it.
**
** On success, a handle for the open file is written to *id
** and *pReadonly is set to 0 if the file was opened for reading and
** writing or 1 if the file was opened read-only.  The function returns
** eDb_OK.
**
** On failure, the function returns eDb_CANTOPEN and leaves
** *id and *pReadonly unchanged.
*/
int eDbOsOpenReadWrite(const char *zFilename,OsFile *id,int *pReadonly){	
	if(FileExist((char *)zFilename) == 0){
		CreateFile((char *)zFilename);
	}
	id->h = OpenFile((char *)zFilename,FILEMODE_READ|FILEMODE_WRITE);
	id->locked = 0;
	*pReadonly = 0;
	return eDb_OK;
}


/*
** Attempt to open a new file for exclusive access by this process.
** The file will be opened for both reading and writing.  To avoid
** a potential security problem, we do not allow the file to have
** previously existed.  Nor do we allow the file to be a symbolic
** link.
**
** If delFlag is true, then make arrangements to automatically delete
** the file when it is closed.
**
** On success, write the file handle into *id and return eDb_OK.
**
** On failure, return eDb_CANTOPEN.
*/
int eDbOsOpenExclusive(const char *zFilename, OsFile *id, int delFlag){	
	if(FileExist((char *)zFilename) == 0){
		CreateFile((char *)zFilename);
	}
	id->h = OpenFile((char *)zFilename,FILEMODE_READ|FILEMODE_WRITE);
	id->locked = 0;
	delFlag = delFlag;
	return eDb_OK;
}

/*
** Attempt to open a new file for read-only access.
**
** On success, write the file handle into *id and return eDb_OK.
**
** On failure, return eDb_CANTOPEN.
*/
int eDbOsOpenReadOnly(const char *zFilename, OsFile *id){
	if(FileExist((char *)zFilename) == 0){
		CreateFile((char *)zFilename);
	}
	id->h = OpenFile((char *)zFilename,FILEMODE_READ);
	id->locked = 0;
	return eDb_OK;
}

/*
** Attempt to open a file descriptor for the directory that contains a
** file.  This file descriptor can be used to fsync() the directory
** in order to make sure the creation of a new file is actually written
** to disk.
**
** This routine is only meaningful for Unix.  It is a no-op under
** windows since windows does not support hard links.
**
** On success, a handle for a previously open file is at *id is
** updated with the new directory file descriptor and eDb_OK is
** returned.
**
** On failure, the function returns eDb_CANTOPEN and leaves
** *id unchanged.
*/
int eDbOsOpenDirectory(const char *zDirname,OsFile *id){
	return eDb_OK;
}

/*
** Create a temporary file name in zBuf.  zBuf must be big enough to
** hold at least eDb_TEMPNAME_SIZE characters.
*/
void eDbRandomness(int N, void *pBuf);
int eDbOsTempFileName(char *zBuf){

	return eDb_OK; 
}

/*
** Close a file.
*/
int eDbOsClose(OsFile *id){
	CloseFile(id->h);
	id->locked = 0;
	return eDb_OK;
}

/*
** Read data from a file into a buffer.  Return eDb_OK if all
** bytes were read successfully and eDb_IOERR if anything goes
** wrong.
*/
int eDbOsRead(OsFile *id, void *pBuf, int amt){
	int n = ReadFile(id->h,(u8 *)pBuf,amt);
	if(n == amt)
		return eDb_OK;
	else
		return eDb_ERROR;
}

/*
** Write data from a buffer into a file.  Return eDb_OK on success
** or some other error code on failure.
*/
int eDbOsWrite(OsFile *id, const void *pBuf, int amt){	
	int n = WriteFile(id->h,(u8 *)pBuf,amt);
	if(n == amt)
		return eDb_OK;
	else
		return eDb_ERROR;
}

/*
** Move the read/write pointer in a file.
*/
int eDbOsSeek(OsFile *id, off_t offset){
	SeekFile(id->h,offset,FILESEEK_SET);
	return eDb_OK;
}

/*
** Make sure all writes to a particular file are committed to disk.
**
** Under Unix, also make sure that the directory entry for the file
** has been created by fsync-ing the directory that contains the file.
** If we do not do this and we encounter a power failure, the directory
** entry for the journal might not exist after we reboot.  The next
** eDb to access the file will not know that the journal exists (because
** the directory entry for the journal was never created) and the transaction
** will not roll back - possibly leading to database corruption.
*/
int eDbOsSync(OsFile *id){
	FlushFile(id->h);
	return eDb_OK;
}

/*
** Truncate an open file to a specified size
*/
int eDbOsTruncate(OsFile *id, off_t nByte){
	return eDb_OK;
}

/*
** Determine the current size of a file in bytes
*/
int eDbOsFileSize(OsFile *id, off_t *pSize){
	*pSize = FileSize(id->h);
	return eDb_OK;
}
int eDbOsReadLock(OsFile *id){
	return eDb_OK;
}

/*
** Change the lock status to be an exclusive or write lock.  Return
** eDb_OK on success and eDb_BUSY on a failure.  If this
** library was compiled with large file support (LFS) but LFS is not
** available on the host, then an eDb_NOLFS is returned.
*/
int eDbOsWriteLock(OsFile *id){	
	return eDb_OK;
}

/*
** Unlock the given file descriptor.  If the file descriptor was
** not previously locked, then this routine is a no-op.  If this
** library was compiled with large file support (LFS) but LFS is not
** available on the host, then an eDb_NOLFS is returned.
*/
int eDbOsUnlock(OsFile *id){	
	return eDb_OK;
}

/*
** Get information to seed the random number generator.  The seed
** is written into the buffer zBuf[256].  The calling function must
** supply a sufficiently large buffer.
*/
int eDbOsRandomSeed(char *zBuf){
	int i;
	for(i=0;i<256;i++)
		zBuf[i] = i%128;
	return eDb_OK;
}

/*
** Sleep for a little while.  Return the amount of time slept.
*/
int eDbOsSleep(int ms){
	return ms;
}

/*
** Static variables used for thread synchronization
*/
static int inMutex = 0;
void eDbOsEnterMutex(){
	inMutex = 1;
}
void eDbOsLeaveMutex(){
	inMutex = 0;
}

/*
** Turn a relative pathname into a full pathname.  Return a pointer
** to the full pathname stored in space obtained from eDbMalloc().
** The calling function is responsible for freeing this space once it
** is no longer needed.
*/
char *eDbOsFullPathname(const char *zRelative){	
	char *pName = eDbStrDup(zRelative);
	return pName;	
}

/*
** The following variable, if set to a now-zero value, become the result
** returned from eDbOsCurrentTime().  This is used for testing.
*/
#ifdef eDb_TEST
	int eDb_current_time = 0;
#endif

/*
** Find the current time (in Universal Coordinated Time).  Write the
** current time and date as a Julian Day number into *prNow and
** return 0.  Return 1 if the time and date cannot be found.
*/
int eDbOsCurrentTime(double *prNow){
	return 0;
}


/*
** Get a single 8-bit random value from the RC4 PRNG.  The Mutex
** must be held while executing this routine.
**
** Why not just use a library random generator like lrand48() for this?
** Because the OP_NewRecno opcode in the VDBE depends on having a very
** good source of random numbers.  The lrand48() library function may
** well be good enough.  But maybe not.  Or maybe lrand48() has some
** subtle problems on some systems that could cause problems.  It is hard
** to know.  To minimize the risk of problems due to bad lrand48()
** implementations, eDb uses this random number generator based
** on RC4, which we know works very well.
*/
static int randomByte(){
	unsigned char t;

  /* All threads share a single random number generator.
  ** This structure is the current state of the generator.
  */
	static struct {
		unsigned char isInit;          /* True if initialized */
		unsigned char i, j;            /* State variables */
		unsigned char s[256];          /* State variables */
	} prng;

  /* Initialize the state of the random number generator once,
  ** the first time this routine is called.  The seed value does
  ** not need to contain a lot of randomness since we are not
  ** trying to do secure encryption or anything like that...
  **
  ** Nothing in this file or anywhere else in eDb does any kind of
  ** encryption.  The RC4 algorithm is being used as a PRNG (pseudo-random
  ** number generator) not as an encryption device.
  */
	if( !prng.isInit ){
		int i;
		char k[256];
		prng.j = 0;
		prng.i = 0;
		eDbOsRandomSeed(k);
		for(i=0; i<256; i++){
			prng.s[i] = i;
		}
		for(i=0; i<256; i++){
			prng.j += prng.s[i] + k[i];
			t = prng.s[prng.j];
			prng.s[prng.j] = prng.s[i];
			prng.s[i] = t;
		}
		prng.isInit = 1;
	}

	/* Generate and return single random byte
	*/
	prng.i++;
	t = prng.s[prng.i];
	prng.j += t;
	prng.s[prng.i] = prng.s[prng.j];
	prng.s[prng.j] = t;
	t += prng.s[prng.i];
	return prng.s[t];
}

/*
** Return N random bytes.
*/
void eDbRandomness(int N, void *pBuf){
	unsigned char *zBuf = pBuf;
	eDbOsEnterMutex();
	while( N-- ){
		*(zBuf++) = randomByte();
	}
	eDbOsLeaveMutex();
}

#ifndef itoa
char *itoa(int n, char *str,int rad){
	extern int sprintf(char *str,const char *format,...);
	switch(rad){
		case 10:
			sprintf(str,"%d",n);
			break;
		case 16:
			sprintf(str,"%x",n);
			break;
		case 8:
			sprintf(str,"%o",n);
			break;
		default:
			sprintf(str,"%d",n);			
	}
	
	return 0;
}
#endif

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91精品国产欧美一区二区18| 亚洲女人的天堂| 亚洲欧洲日韩在线| 亚洲高清不卡在线观看| 久久国产婷婷国产香蕉| 不卡的av电影在线观看| 7777精品伊人久久久大香线蕉超级流畅 | 26uuu久久综合| 中文字幕欧美国产| 日本免费新一区视频| 国产成人免费视频网站| 欧美日韩精品欧美日韩精品一 | 色94色欧美sute亚洲线路一久| 欧美三级日韩三级国产三级| 精品国产乱码久久久久久久 | 奇米色777欧美一区二区| 国产.欧美.日韩| 日韩三级免费观看| 久久精品亚洲精品国产欧美| 91丨porny丨国产| 日韩欧美一卡二卡| 有坂深雪av一区二区精品| 久久99热99| 7777精品伊人久久久大香线蕉完整版 | 亚洲欧美怡红院| 蜜臀精品一区二区三区在线观看| av午夜一区麻豆| 国产日产欧产精品推荐色| 日韩电影在线看| 亚洲欧美一区二区三区国产精品| 粉嫩av亚洲一区二区图片| 26uuu亚洲婷婷狠狠天堂| 日韩精品一二三四| 精品欧美乱码久久久久久| 日韩精品一区二区在线| 日韩精品电影在线| 欧美成人三级电影在线| 麻豆成人综合网| 欧美日韩电影在线| 一区二区三区四区不卡在线 | 国产裸体歌舞团一区二区| 欧美一区二区三区视频在线观看| 亚洲第一在线综合网站| 欧美一区二区三区成人| 国产电影一区二区三区| 久久欧美中文字幕| 色哟哟国产精品| 亚洲一区在线看| 91精品国产综合久久福利软件| 国产一区二区在线观看视频| 国产丝袜欧美中文另类| 色先锋资源久久综合| 国产乱子伦视频一区二区三区 | 日韩国产成人精品| 亚洲色欲色欲www| 精品国产凹凸成av人网站| 成人精品小蝌蚪| 首页国产欧美久久| 国产精品第一页第二页第三页| 在线看一区二区| 国产在线不卡一区| 亚洲国产综合视频在线观看| 日韩欧美一级在线播放| av色综合久久天堂av综合| 免费观看久久久4p| 日本亚洲电影天堂| 国产欧美日韩不卡免费| 日韩三级.com| 色综合久久久久综合| 国内精品免费**视频| 亚洲精选视频在线| 国产日韩在线不卡| 欧美另类videos死尸| 色婷婷国产精品| 狠狠色丁香婷综合久久| 亚洲一区二区三区四区在线观看 | 亚洲午夜激情av| 中文字幕中文字幕中文字幕亚洲无线 | 久久婷婷色综合| 国产视频一区二区三区在线观看| 欧美成人aa大片| 这里只有精品99re| 欧美视频中文一区二区三区在线观看| 国产激情精品久久久第一区二区 | 高清免费成人av| 国产精一区二区三区| 精品无人码麻豆乱码1区2区| 男人操女人的视频在线观看欧美| 亚洲国产综合在线| 丝袜亚洲精品中文字幕一区| 91精品国产综合久久香蕉麻豆| 欧美性视频一区二区三区| 色婷婷久久综合| 欧美日韩在线亚洲一区蜜芽| 欧美手机在线视频| 欧美日韩国产片| 日韩欧美美女一区二区三区| 精品国产一区二区国模嫣然| 久久色视频免费观看| 欧美韩国日本综合| 亚洲欧美日本在线| 亚洲成人免费在线| 久久99精品久久久久久动态图 | 亚洲高清在线视频| 午夜一区二区三区视频| 日韩电影免费一区| 国内久久精品视频| 91一区二区三区在线观看| 欧美亚洲禁片免费| 精品国产sm最大网站免费看| 中文字幕一区二区三区四区不卡| 亚洲午夜激情网站| 精品一区二区三区免费毛片爱| 国产精品亚洲成人| 欧美日韩国产高清一区| 精品国产伦理网| 亚洲美女电影在线| 麻豆精品国产91久久久久久| 成人福利在线看| 日韩精品一区二区三区视频| 国产嫩草影院久久久久| 天天色天天操综合| 国产69精品久久99不卡| 欧美巨大另类极品videosbest | 国产喂奶挤奶一区二区三区| 一个色妞综合视频在线观看| 日本亚洲最大的色成网站www| 成人av网站免费| 久久久久亚洲蜜桃| 日韩av一区二区在线影视| caoporen国产精品视频| 精品av久久707| 国内精品久久久久影院色 | 韩国av一区二区| 67194成人在线观看| 亚洲女同ⅹxx女同tv| 成人h版在线观看| 国产女人18毛片水真多成人如厕| 日韩精品一区第一页| 亚洲日本成人在线观看| 一区二区在线观看视频在线观看| 亚洲精品第1页| 91麻豆视频网站| 欧美激情在线一区二区| 国产精品一区免费在线观看| 日韩午夜在线观看视频| 男男视频亚洲欧美| 欧美精品一二三| 免费人成精品欧美精品| 欧美日韩国产影片| 日韩制服丝袜av| 91精品国产色综合久久不卡电影 | 国内久久精品视频| 久久久久久久久久看片| 国产又粗又猛又爽又黄91精品| 欧美一二三区在线观看| 精品影视av免费| 夜夜嗨av一区二区三区中文字幕| 国产成人精品一区二区三区四区| 在线观看一区不卡| 亚洲精品一二三区| 成人在线综合网| 日韩毛片在线免费观看| 欧美日韩小视频| 蜜臀国产一区二区三区在线播放| 日韩欧美国产精品| 国产精品影视网| 亚洲美女视频在线观看| 91精品婷婷国产综合久久| 国产美女娇喘av呻吟久久| 国产精品系列在线| 在线成人av网站| 成人国产精品视频| 日日噜噜夜夜狠狠视频欧美人| 久久精品一二三| 欧美天堂亚洲电影院在线播放| 久久精品国产精品亚洲精品| 一区在线观看视频| 精品国产123| 在线观看国产日韩| 国产成人综合亚洲91猫咪| 樱桃国产成人精品视频| 日韩精品一区二| 精品视频在线免费看| av一区二区三区黑人| 国产主播一区二区三区| 三级久久三级久久| 亚洲狠狠丁香婷婷综合久久久| 久久精品视频免费观看| 日韩视频在线观看一区二区| 欧日韩精品视频| av成人动漫在线观看| 国产高清不卡二三区| 精品电影一区二区| 91精品国产综合久久久蜜臀图片| 欧美亚洲一区二区在线| 91美女片黄在线观看| 色偷偷久久一区二区三区| 一本久久a久久免费精品不卡| 成人不卡免费av|