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

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

?? stream.c

?? cryptlib是功能強(qiáng)大的安全工具集。允許開發(fā)人員快速在自己的軟件中集成加密和認(rèn)證服務(wù)。
?? C
?? 第 1 頁 / 共 3 頁
字號:
		assert( NOTREACHED );
		return( CRYPT_ERROR_WRITE );
		}
	if( stream->type != STREAM_TYPE_NULL && \
		( stream->bufPos < 0 || stream->bufPos > stream->bufSize ) )
		{
		assert( NOTREACHED );
		return( sSetError( stream, CRYPT_ERROR_WRITE ) );
		}

	/* If there's a problem with the stream, don't try to do anything until
	   the error is cleared */
	if( cryptStatusError( stream->status ) )
		return( stream->status );

	switch( stream->type )
		{
		case STREAM_TYPE_NULL:
			assert( !stream->flags );

			/* It's a null stream, just record the write and return */
			stream->bufPos++;
			if( stream->bufEnd < stream->bufPos )
				stream->bufEnd = stream->bufPos;
			return( CRYPT_OK );

		case STREAM_TYPE_MEMORY:
			assert( !( stream->flags & ~STREAM_FLAG_MASK ) );

			/* Write the data to the stream buffer */
			if( stream->bufPos >= stream->bufSize )
				{
				stream->status = CRYPT_ERROR_OVERFLOW;
				return( CRYPT_ERROR_OVERFLOW );
				}
			stream->buffer[ stream->bufPos++ ] = ch;
			if( stream->bufEnd < stream->bufPos )
				stream->bufEnd = stream->bufPos;

			return( CRYPT_OK );

		case STREAM_TYPE_FILE:
			assert( !( stream->flags & ~STREAM_FFLAG_MASK ) );

			/* Write the data to the file */
			if( stream->bufPos >= stream->bufSize )
				{
				int status;

				status = emptyStream( stream, FALSE );
				if( cryptStatusError( status ) )
					return( status );
				}
			stream->buffer[ stream->bufPos++ ] = ch;
			stream->flags |= STREAM_FFLAG_DIRTY;

			return( CRYPT_OK );
		}

	assert( NOTREACHED );
	return( CRYPT_ERROR_WRITE );	/* Get rid of compiler warning */
	}

int swrite( STREAM *stream, const void *buffer, const int length )
	{
	assert( isWritePtr( stream, sizeof( STREAM ) ) );
	assert( stream->type == STREAM_TYPE_NULL || \
			stream->type == STREAM_TYPE_MEMORY || \
			stream->type == STREAM_TYPE_FILE || \
			stream->type == STREAM_TYPE_NETWORK );
	assert( stream->type == STREAM_TYPE_NULL || \
			stream->type == STREAM_TYPE_NETWORK || \
			isWritePtr( stream->buffer, stream->bufSize ) );
	assert( stream->type == STREAM_TYPE_NULL || \
			stream->type == STREAM_TYPE_NETWORK || \
			( stream->bufPos >= 0 && stream->bufPos <= stream->bufSize ) );
	assert( isReadPtr( buffer, length ) );
	assert( length > 0 );
	assert( !( stream->flags & STREAM_FLAG_READONLY ) );

	/* Check that the input parameters are in order */
	if( !isWritePtr( stream, sizeof( STREAM ) ) )
		{
		assert( NOTREACHED );
		return( CRYPT_ERROR_WRITE );
		}
	if( ( stream->type != STREAM_TYPE_NULL && \
		  stream->type != STREAM_TYPE_NETWORK && \
		  ( stream->bufPos < 0 || stream->bufPos > stream->bufSize ) ) || \
		!isReadPtr( buffer, length ) )
		{
		assert( NOTREACHED );
		return( sSetError( stream, CRYPT_ERROR_WRITE ) );
		}

	/* If there's a problem with the stream, don't try to do anything until
	   the error is cleared */
	if( cryptStatusError( stream->status ) )
		return( stream->status );

	switch( stream->type )
		{
		case STREAM_TYPE_NULL:
			assert( !stream->flags );

			/* It's a null stream, just record the write and return */
			stream->bufPos += length;
			if( stream->bufEnd < stream->bufPos )
				stream->bufEnd = stream->bufPos;
			return( CRYPT_OK );

		case STREAM_TYPE_MEMORY:
			assert( !( stream->flags & ~STREAM_FLAG_MASK ) );

			/* Write the data to the stream buffer */
			if( stream->bufPos + length > stream->bufSize )
				{
				stream->status = CRYPT_ERROR_OVERFLOW;
				return( CRYPT_ERROR_OVERFLOW );
				}
			memcpy( stream->buffer + stream->bufPos, buffer, length );
			stream->bufPos += length;
			if( stream->bufEnd < stream->bufPos )
				stream->bufEnd = stream->bufPos;

			return( CRYPT_OK );

		case STREAM_TYPE_FILE:
			{
			const BYTE *bufPtr = buffer;
			int dataLength = length;

			assert( !( stream->flags & ~STREAM_FFLAG_MASK ) );

			/* Write the data to the file */
			while( dataLength > 0 )
				{
				const int bytesToCopy = \
						min( dataLength, stream->bufSize - stream->bufPos );

				if( bytesToCopy > 0 )
					{
					memcpy( stream->buffer + stream->bufPos, bufPtr, 
							bytesToCopy );
					stream->bufPos += bytesToCopy;
					bufPtr += bytesToCopy;
					dataLength -= bytesToCopy;
					}
				if( stream->bufPos >= stream->bufSize )
					{
					int status;

					status = emptyStream( stream, FALSE );
					if( cryptStatusError( status ) )
						return( status );
					}
				}
			stream->flags |= STREAM_FFLAG_DIRTY;

			return( CRYPT_OK );
			}

#ifdef USE_TCP
		case STREAM_TYPE_NETWORK:
			{
			int status;

			assert( !( stream->flags & ~STREAM_NFLAG_MASK ) );
			assert( stream->writeFunction != NULL );
			assert( ( stream->flags & STREAM_NFLAG_ISSERVER ) || \
					stream->host != NULL || \
					stream->netSocket != CRYPT_ERROR );
			assert( stream->timeout >= 0 && stream->timeout <= 300 );

			/* Write the data to the network.  Writes are normally atomic, 
			   but when doing bulk data transfers can be restarted after
			   a timeout */
			status = stream->writeFunction( stream, buffer, length );
			if( cryptStatusError( status ) )
				return( status );
			if( status < length && \
				!( stream->flags & STREAM_FLAG_PARTIALWRITE ) )
				{
				/* If we didn't write all of the data and partial writes 
				   aren't allowed, report a write timeout */
				retExtStream( stream, CRYPT_ERROR_TIMEOUT,
							  "Write timed out with %d of %d bytes written",
							  status, length );
				}
			return( status );
			}
#endif /* USE_TCP */
		}

	assert( NOTREACHED );
	return( CRYPT_ERROR_WRITE );	/* Get rid of compiler warning */
	}

/* Commit data in a stream to backing storage */

int sflush( STREAM *stream )
	{
	int status = CRYPT_OK, flushStatus;

	assert( isWritePtr( stream, sizeof( STREAM ) ) );
	assert( stream->type == STREAM_TYPE_FILE );
	assert( isReadPtr( stream->buffer, stream->bufSize ) );
	assert( !( stream->flags & STREAM_FLAG_READONLY ) );

	/* Check that the input parameters are in order */
	if( !isWritePtr( stream, sizeof( STREAM ) ) )
		{
		assert( NOTREACHED );
		return( CRYPT_ERROR_WRITE );
		}
	if( !isReadPtr( stream->buffer, stream->bufSize ) )
		{
		assert( NOTREACHED );
		return( sSetError( stream, CRYPT_ERROR_WRITE ) );
		}

	/* If there's a problem with the stream, don't try to do anything until
	   the error is cleared */
	if( cryptStatusError( stream->status ) )
		return( stream->status );

	/* If the data is unchanged, there's nothing to do */
	if( !( stream->flags & STREAM_FFLAG_DIRTY ) )
		return( CRYPT_OK );

	/* If there's data still in the stream buffer, write it to disk */
	if( stream->bufPos > 0 )
		status = emptyStream( stream, TRUE );

	/* Commit the data */
	flushStatus = fileFlush( stream );
	stream->flags &= ~STREAM_FFLAG_DIRTY;

	return( cryptStatusOK( status ) ? flushStatus : status );
	}

/****************************************************************************
*																			*
*								Meta-data Functions							*
*																			*
****************************************************************************/

/* Move to an absolute position in a stream */

int sseek( STREAM *stream, const long position )
	{
	assert( isWritePtr( stream, sizeof( STREAM ) ) );
	assert( stream->type == STREAM_TYPE_NULL || \
			stream->type == STREAM_TYPE_MEMORY || \
			stream->type == STREAM_TYPE_FILE );
	assert( position >= 0 );

	/* Check that the input parameters are in order */
	if( !isWritePtr( stream, sizeof( STREAM ) ) )
		{
		assert( NOTREACHED );
		return( CRYPT_ERROR_READ );
		}
	if( position < 0 )
		{
		assert( NOTREACHED );
		return( sSetError( stream, CRYPT_ERROR_READ ) );
		}

	switch( stream->type )
		{
		case STREAM_TYPE_NULL:
			assert( !stream->flags );

			/* Move to the position in the stream buffer.  We never get 
			   called directly with an sseek on a memory stream, but end up 
			   here via a translated sSkip() call */
			stream->bufPos = ( int ) position;
			if( stream->bufEnd < stream->bufPos )
				stream->bufEnd = stream->bufPos;
			return( CRYPT_OK );

		case STREAM_TYPE_MEMORY:
			assert( !( stream->flags & ~STREAM_FLAG_MASK ) );

			/* Move to the position in the stream buffer */
			if( ( int ) position > stream->bufSize )
				{
				stream->bufPos = stream->bufSize;
				stream->status = CRYPT_ERROR_UNDERFLOW;
				return( CRYPT_ERROR_UNDERFLOW );
				}
			stream->bufPos = ( int ) position;
			if( stream->bufEnd < stream->bufPos )
				stream->bufEnd = stream->bufPos;
			return( CRYPT_OK );

		case STREAM_TYPE_FILE:
			{
			int newBufCount;

			assert( !( stream->flags & ~STREAM_FFLAG_MASK ) );

			/* If it's a currently-disconnected file stream, all that we can 
			   do is rewind the stream.  This occurs when we're doing an 
			   atomic flush of data to disk and we rewind the stream prior 
			   to writing the new/updated data.  The next buffer-connect 
			   operation will reset the stream state, so there's nothing to 
			   do at this point */
			if( stream->bufSize <= 0 )
				{
				assert( position == 0 );
				return( CRYPT_OK );
				}

			/* It's a file stream, remember the new position in the file */
			newBufCount = position / stream->bufSize;
			if( newBufCount != stream->bufCount )
				{
				/* We're not within the current buffer any more, remember 
				   that we have to explicitly update the file position on
				   the next read */
				stream->flags |= STREAM_FFLAG_POSCHANGED;

				/* If we're already positioned to read the next bufferful 
				   of data, we don't have to explicitly skip ahead to it */
				if( newBufCount == stream->bufCount + 1 ) 
					stream->flags |= STREAM_FFLAG_POSCHANGED_NOSKIP ;

				stream->bufCount = newBufCount;
				}
			stream->bufPos = position % stream->bufSize;
			return( CRYPT_OK );
			}
		}

	assert( NOTREACHED );
	return( CRYPT_ERROR_WRITE );	/* Get rid of compiler warning */
	}

/* Skip a number of bytes in a stream */

int sSkip( STREAM *stream, const long offset )
	{
	assert( isWritePtr( stream, sizeof( STREAM ) ) );
	assert( stream->type == STREAM_TYPE_NULL || \
			stream->type == STREAM_TYPE_MEMORY || \
			stream->type == STREAM_TYPE_FILE );
	assert( offset > 0 );

	/* Check that the input parameters are in order */
	if( !isWritePtr( stream, sizeof( STREAM ) ) )
		{
		assert( NOTREACHED );
		return( CRYPT_ERROR_READ );
		}
	if( offset <= 0 )
		{
		assert( NOTREACHED );
		return( sSetError( stream, CRYPT_ERROR_READ ) );
		}

	return( sseek( stream, stream->bufPos + offset ) );
	}

/* Peek at the next data value in a stream */

int sPeek( STREAM *stream )
	{
	assert( isWritePtr( stream, sizeof( STREAM ) ) );
	assert( stream->type == STREAM_TYPE_MEMORY || \
			stream->type == STREAM_TYPE_FILE );
	assert( stream->bufPos >= 0 && stream->bufPos <= stream->bufEnd );
	assert( isReadPtr( stream->buffer, stream->bufSize ) );

	/* Check that the input parameters are in order */
	if( !isWritePtr( stream, sizeof( STREAM ) ) )
		{
		assert( NOTREACHED );
		return( CRYPT_ERROR_READ );
		}
	if( stream->bufPos < 0 || stream->bufPos > stream->bufEnd || \
		!isReadPtr( stream->buffer, stream->bufSize ) )

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲男人的天堂一区二区| 国产在线不卡一卡二卡三卡四卡| 国产精品天美传媒| 久久久精品日韩欧美| 精品久久久久av影院| 精品国产百合女同互慰| 精品国产一区二区亚洲人成毛片 | av不卡免费在线观看| 成人永久看片免费视频天堂| 成人黄色软件下载| 91免费看片在线观看| 色先锋资源久久综合| 色噜噜久久综合| 欧美日韩国产首页| 精品少妇一区二区三区视频免付费 | 自拍偷在线精品自拍偷无码专区| 国产欧美日韩在线视频| 中文字幕亚洲精品在线观看| 亚洲色图一区二区| 亚洲一区二区欧美激情| 日韩国产在线一| 精品一区二区三区在线播放视频| 国产福利一区二区| 91玉足脚交白嫩脚丫在线播放| 色八戒一区二区三区| 欧美日本国产视频| 久久综合成人精品亚洲另类欧美 | 久久精品国产亚洲5555| 九一久久久久久| 成人免费高清在线| 欧美性大战久久久| 26uuu国产电影一区二区| 国产精品网友自拍| 午夜精品久久久久| 国产在线精品免费| 色婷婷久久久亚洲一区二区三区 | 欧美日韩不卡一区| 久久伊人中文字幕| 亚洲欧美aⅴ...| 日日噜噜夜夜狠狠视频欧美人| 精品一区二区三区在线播放| 91在线观看地址| 欧美一区二区福利在线| 国产精品美女一区二区在线观看| 亚洲一二三级电影| 国产一区二区三区国产| 欧美日韩在线播放一区| 2020国产精品| 亚洲国产一区视频| 国产精品一区专区| 欧美日韩情趣电影| 中文一区一区三区高中清不卡| 亚洲图片有声小说| 国产91丝袜在线播放| 欧美午夜精品久久久久久孕妇| 久久久亚洲欧洲日产国码αv| 亚洲精品国产视频| 国产精品18久久久久久vr| 欧美日韩一区视频| 中文字幕精品在线不卡| 青青草国产精品97视觉盛宴| 粉嫩绯色av一区二区在线观看| 欧美日韩一区二区三区在线看| 国产人久久人人人人爽| 首页亚洲欧美制服丝腿| 色哟哟一区二区| 国产日韩欧美精品一区| 麻豆成人免费电影| 欧美自拍偷拍午夜视频| 国产女人水真多18毛片18精品视频| 天天综合色天天| 91丨porny丨首页| 亚洲国产综合91精品麻豆| 成人免费高清视频| 久久网站最新地址| 日韩二区三区四区| 欧美综合久久久| 亚洲免费观看高清完整版在线观看 | 一区二区三区在线观看视频| 国产成人午夜99999| 日韩精品中文字幕一区二区三区| 亚洲一区二区三区自拍| 91在线porny国产在线看| 国产欧美一区二区在线观看| 麻豆精品久久精品色综合| 欧美日韩第一区日日骚| 亚洲一区影音先锋| 日本久久一区二区| 亚洲嫩草精品久久| 91网站在线播放| 亚洲欧美综合在线精品| 成人精品免费视频| 国产精品午夜久久| 成人性生交大片| 欧美激情综合在线| 国产成人亚洲精品狼色在线 | 韩国精品在线观看| 欧美大片免费久久精品三p| 午夜精品aaa| 欧美精品久久一区二区三区| 亚洲综合精品自拍| 欧美私模裸体表演在线观看| 亚洲一区二区三区自拍| 精品视频色一区| 午夜精品久久久久久不卡8050| 欧美丝袜自拍制服另类| 亚洲午夜免费电影| 欧美日韩一区三区四区| 天堂午夜影视日韩欧美一区二区| 欧美精品久久久久久久多人混战| 亚洲h在线观看| 日韩美女视频在线| 国产成人精品影院| 国产精品成人免费| 欧美亚洲尤物久久| 偷拍亚洲欧洲综合| 欧美zozo另类异族| 国产精品一区二区三区99| 欧美国产日本视频| 色成人在线视频| 日韩1区2区3区| 26uuu精品一区二区| 成人免费不卡视频| 亚洲精品乱码久久久久| 欧美日韩另类一区| 狠狠狠色丁香婷婷综合激情| 国产欧美精品在线观看| 91在线国产福利| 日产欧产美韩系列久久99| 国产色综合久久| 一本大道综合伊人精品热热| 亚洲综合激情网| 日韩免费观看2025年上映的电影| 国产九色sp调教91| 亚洲美女一区二区三区| 在线不卡中文字幕| 国产成人夜色高潮福利影视| 一区二区三区日韩欧美精品| 欧美国产成人在线| 欧美日韩国产精品成人| 狠狠色狠狠色综合| 一区二区三区国产豹纹内裤在线| 3d成人h动漫网站入口| 国产精品一区三区| 一区二区激情小说| 欧美va亚洲va在线观看蝴蝶网| 成人黄色777网| 日本不卡中文字幕| 国产精品美女一区二区三区| 欧美日韩在线直播| 国产69精品一区二区亚洲孕妇| 一区二区欧美精品| 久久久精品蜜桃| 欧美日韩成人综合天天影院| 国产91富婆露脸刺激对白| 午夜精品久久久久久久99樱桃| 日本一区二区成人在线| 欧美另类z0zxhd电影| 成人性视频免费网站| 美女mm1313爽爽久久久蜜臀| 成人欧美一区二区三区白人| 日韩三级免费观看| 91精品办公室少妇高潮对白| 久久国产剧场电影| 亚洲一区二区偷拍精品| 国产精品女上位| 久久这里只有精品6| 欧美日韩综合色| 成人高清视频在线| 久久国内精品视频| 天天影视网天天综合色在线播放| 国产精品成人免费在线| 久久新电视剧免费观看| 在线综合+亚洲+欧美中文字幕| 色综合久久久久综合99| 国产成人综合自拍| 美女网站在线免费欧美精品| 亚洲综合图片区| 亚洲色图.com| 欧美国产日韩一二三区| 久久综合久久综合九色| 在线播放中文一区| 欧美视频在线观看一区二区| 99v久久综合狠狠综合久久| 国产精品自拍三区| 韩国精品在线观看| 精品在线亚洲视频| 免费在线观看一区二区三区| 亚洲国产欧美日韩另类综合 | 日韩毛片在线免费观看| 久久影音资源网| 精品国产亚洲一区二区三区在线观看| 精品视频全国免费看| 欧美三级资源在线| 欧美无砖砖区免费| 欧洲精品中文字幕| 91久久精品日日躁夜夜躁欧美| 色综合久久88色综合天天免费| 成人国产在线观看| www.视频一区|