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

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

?? fseek.c

?? vxwork源代碼
?? C
字號:
/* fseek.c - seek a position in a file. stdio.h *//* Copyright 1992-1993 Wind River Systems, Inc. *//*modification history--------------------01d,05feb99,dgp  document errno values01c,05mar93,jdi  documentation cleanup for 5.1.01b,20sep92,smb  documentation additions01a,29jul92,jcf  Added OBJ_VERIFY	   +smb  taken from UCB stdio, removed fstat().*//*DESCRIPTION * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. * * This code is derived from software contributed to Berkeley by * Chris Torek. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright *    notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright *    notice, this list of conditions and the following disclaimer in the *    documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software *    must display the following acknowledgement: *	This product includes software developed by the University of *	California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors *    may be used to endorse or promote products derived from this software *    without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE.INCLUDE FILE: stdio.h, sys/types.h, sys/stat.h, fcntl.h, stdlib.h, errno.hSEE ALSO: American National Standard X3.159-1989NOMANUAL*/#include "vxWorks.h"#include "stdio.h"#include "ioLib.h"#include "sys/types.h"#include "sys/stat.h"#include "fcntl.h"#include "stdlib.h"#include "errno.h"#include "objLib.h"#include "private/stdioP.h"#define	POS_ERR	(-(fpos_t)1)/******************************************************************************** fseek - set the file position indicator for a stream (ANSI)** This routine sets the file position indicator for a specified stream.* For a binary stream, the new position, measured in characters from the * beginning of the file, is obtained by adding <offset> to the position * specified by <whence>, whose possible values are:* .iP SEEK_SET 16* the beginning of the file.* .iP SEEK_CUR* the current value of the file position indicator.* .iP SEEK_END* the end of the file.* .LP* A binary stream does not meaningfully* support fseek() calls with a <whence> value of SEEK_END.** For a text stream, either <offset> is zero, or <offset> is a value* returned by an earlier call to ftell() on the stream, in which case* <whence> should be SEEK_SET.** A successful call to fseek() clears the end-of-file indicator for the* stream and undoes any effects of ungetc() on the same stream.  After an* fseek() call, the next operation on an update stream can be either input* or output.* * INCLUDE FILES: stdio.h ** RETURNS: Non-zero only for a request that cannot be satisfied.** ERRNO: EINVAL** SEE ALSO: ftell()*/int fseek    (    FAST FILE *	fp,		/* stream */    long	offset,		/* offset from <whence> */    int		whence		/* position to offset from: */				/* SEEK_SET = beginning */				/* SEEK_CUR = current position */				/* SEEK_END = end-of-file */    )    {    fpos_t	target;    fpos_t	curoff;    size_t	n;    struct stat st;    int		havepos;    BOOL	doStat;    if (OBJ_VERIFY (fp, fpClassId) != OK)	return (ERROR);    /*     * Change any SEEK_CUR to SEEK_SET, and check `whence' argument.     * After this, whence is either SEEK_SET or SEEK_END.     */    switch (whence) 	{	case SEEK_CUR:		/*		 * In order to seek relative to the current stream offset,		 * we have to first find the current stream offset a la		 * ftell (see ftell for details).		 */		if (fp->_flags & __SOFF)		    curoff = fp->_offset;		else 		    {		    curoff = __sseek (fp, (fpos_t)0, SEEK_CUR);		    if (curoff == -1L)			return (EOF);		    }		if (fp->_flags & __SRD) 		    {		    curoff -= fp->_r;		    if (HASUB(fp))			curoff -= fp->_ur;		    }		else if (fp->_flags & __SWR && fp->_p != NULL)		    curoff += fp->_p - fp->_bf._base;		offset += curoff;		whence	= SEEK_SET;		havepos = 1;		break;	case SEEK_SET:	case SEEK_END:		curoff = 0;		/* XXX just to keep gcc quiet */		havepos = 0;		break;	default:		errno = EINVAL;		return (EOF);	}    /*     * Can only optimise if:     *	reading (and not reading-and-writing);     *	not unbuffered; and     *	this is a `regular' Unix file (and hence seekfn==__sseek).     * We must check __NBF first, because it is possible to have __NBF     * and __SOPT both set.     */    if (fp->_bf._base == NULL)	__smakebuf (fp);    if (fp->_flags & (__SWR | __SRW | __SNBF | __SNPT))	goto dumb;    doStat = ioctl (fp->_file, FIOFSTATGET, (int)&st);    if ((fp->_flags & __SOPT) == 0) 	{	if ((fp->_file < 0 || (doStat) ||	    (st.st_mode & S_IFMT) != S_IFREG)) 	    {	    fp->_flags |= __SNPT;	    goto dumb;	    }	fp->_blksize 	 = st.st_blksize;	fp->_flags	|= __SOPT;	}    /*     * We are reading; we can try to optimise.     * Figure out where we are going and where we are now.     */    if (whence == SEEK_SET)	target = offset;    else 	{	if (doStat)	    goto dumb;	target = st.st_size + offset;	}    if (!havepos) 	{	if (fp->_flags & __SOFF)	    curoff = fp->_offset;	else 	    {	    curoff = __sseek (fp, 0L, SEEK_CUR);	    if (curoff == POS_ERR)		goto dumb;	    }	curoff -= fp->_r;	if (HASUB(fp))	    curoff -= fp->_ur;	}    /*     * Compute the number of bytes in the input buffer (pretending     * that any ungetc() input has been discarded).  Adjust current     * offset backwards by this count so that it represents the     * file offset for the first byte in the current input buffer.     */    if (HASUB(fp)) 	{	n	= fp->_up - fp->_bf._base;	curoff -= n;	n      += fp->_ur;	}     else 	{	n	= fp->_p - fp->_bf._base;	curoff -= n;	n      += fp->_r;	}    /*     * If the target offset is within the current buffer,     * simply adjust the pointers, clear EOF, undo ungetc(),     * and return.  (If the buffer was modified, we have to     * skip this; see fgetline.c.)     */    if (((fp->_flags & __SMOD) == 0) && 	(target >= curoff) && 	(target < (curoff + n))) 	{	FAST int o = target - curoff;	fp->_p = fp->_bf._base + o;	fp->_r = n - o;	if (HASUB(fp))	    FREEUB(fp);	fp->_flags &= ~__SEOF;	return (0);	}    /*     * The place we want to get to is not within the current buffer,     * but we can still be kind to the kernel copyout mechanism.     * By aligning the file offset to a block boundary, we can let     * the kernel use the VM hardware to map pages instead of     * copying bytes laboriously.  Using a block boundary also     * ensures that we only read one block, rather than two.     */    curoff = target & ~(fp->_blksize - 1);    if (__sseek (fp, curoff, SEEK_SET) == POS_ERR)	goto dumb;    fp->_r = 0;    if (HASUB(fp))	FREEUB(fp);    fp->_flags &= ~__SEOF;    n = target - curoff;    if (n) 	{	if (__srefill (fp) || fp->_r < n)	    goto dumb;	fp->_p += n;	fp->_r -= n;	}    return (0);    /*     * We get here if we cannot optimise the seek ... just     * do it.  Allow the seek function to change fp->_bf._base.     */dumb:    if ((__sflush (fp)) || (__sseek (fp, offset, whence) == POS_ERR)) 	return (EOF);    /* success: clear EOF indicator and discard ungetc() data */    if (HASUB(fp))	FREEUB(fp);    fp->_p = fp->_bf._base;    fp->_r = 0;    /* fp->_w = 0; */	/* unnecessary (I think...) */    fp->_flags &= ~__SEOF;    return (0);    }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美视频一区二区| 日本不卡一二三区黄网| 精品国产精品网麻豆系列| 欧美日韩专区在线| 在线观看av一区二区| 日本久久电影网| 色婷婷国产精品| 91成人免费电影| 欧美老年两性高潮| 欧美高清dvd| 精品国产一区二区三区四区四| 777奇米四色成人影色区| 欧美日韩亚洲不卡| 日韩一区二区精品在线观看| 日韩精品一区二区三区中文不卡| 69堂国产成人免费视频| 成人免费毛片aaaaa**| 国产成人午夜99999| 国产成人免费av在线| av网站一区二区三区| 91黄色免费看| 在线不卡中文字幕| 精品日韩99亚洲| 国产精品欧美综合在线| 亚洲另类春色国产| 奇米影视在线99精品| 国产精品77777| 欧美在线免费视屏| 26uuu国产电影一区二区| 国产精品久久久久影院色老大| 综合久久综合久久| 久久精品99国产精品| 国产a视频精品免费观看| 在线观看日韩高清av| 日韩欧美久久久| 国产精品久久久久精k8| 日韩精品久久久久久| 国产91在线观看| 777色狠狠一区二区三区| 久久精品人人做人人综合| 一区二区激情视频| 久久99在线观看| 色婷婷久久久亚洲一区二区三区 | 精品国产不卡一区二区三区| 国产欧美在线观看一区| 亚洲成精国产精品女| 国产盗摄一区二区三区| 欧美久久久久久久久| 国产片一区二区三区| 首页国产欧美日韩丝袜| 成人毛片老司机大片| 日韩一级二级三级精品视频| 亚洲欧美成aⅴ人在线观看| 麻豆精品一区二区av白丝在线| 91麻豆国产精品久久| 久久久不卡网国产精品二区| 亚洲国产精品久久久男人的天堂| 国产成人午夜精品5599| 精品久久久久久久久久久久久久久| 自拍偷拍国产精品| 国产iv一区二区三区| 久久综合狠狠综合| 另类人妖一区二区av| 欧美日韩黄色一区二区| 亚洲欧美一区二区三区国产精品 | 国产盗摄一区二区| 精品国产一区二区在线观看| 日本午夜一本久久久综合| 在线亚洲+欧美+日本专区| 国产精品久久久久久久岛一牛影视| 久久99精品久久久久久国产越南| 欧美日韩午夜在线| 亚洲一卡二卡三卡四卡无卡久久| 国产白丝精品91爽爽久久| 欧美精品在欧美一区二区少妇| 亚洲欧美综合网| 高清不卡在线观看av| 久久影院电视剧免费观看| 久久99热这里只有精品| 欧美va亚洲va香蕉在线| 久久国产婷婷国产香蕉| 欧美一区二区观看视频| 日本不卡视频一二三区| 精品黑人一区二区三区久久 | 亚洲亚洲精品在线观看| 色8久久人人97超碰香蕉987| 亚洲男人天堂av| 色综合久久中文综合久久97| **欧美大码日韩| 色老汉av一区二区三区| 亚洲第一精品在线| 日韩欧美综合一区| 国产经典欧美精品| 亚洲图片激情小说| 欧美日韩中文国产| 蓝色福利精品导航| 中文字幕av不卡| 色综合久久久久综合99| 午夜电影网一区| 精品日韩99亚洲| 91在线播放网址| 奇米精品一区二区三区四区 | 99国产精品久久久久| 亚洲国产日韩综合久久精品| 日韩一区二区在线观看视频播放| 激情久久五月天| 一区二区三区精品视频| 91精品国产综合久久福利| 国产精品一区专区| 亚洲综合成人在线| 亚洲精品一区二区精华| 91麻豆123| 极品少妇xxxx偷拍精品少妇| 亚洲四区在线观看| 日韩美女主播在线视频一区二区三区| 国产成人午夜精品5599| 亚洲成av人在线观看| 国产精品污污网站在线观看| 欧美日韩视频在线第一区 | 首页欧美精品中文字幕| 欧美国产精品专区| 777a∨成人精品桃花网| 成人app在线观看| 日本网站在线观看一区二区三区| 中文字幕成人在线观看| 欧美一区欧美二区| 日本国产一区二区| 国产一区二区毛片| 蜜臀av一区二区三区| 亚洲视频在线观看一区| 久久久久综合网| 91精品国产综合久久精品性色| 91网页版在线| 国产成人精品亚洲午夜麻豆| 奇米四色…亚洲| 日韩在线a电影| 午夜精品久久久久久久| 亚洲综合色丁香婷婷六月图片| 久久精品在这里| 日韩欧美国产电影| 91精品在线观看入口| 欧美日韩一区三区| 色综合 综合色| a4yy欧美一区二区三区| 北条麻妃一区二区三区| 成人一级片网址| 福利电影一区二区三区| 国产精品伊人色| 国产传媒一区在线| 国产精品综合二区| 国产成人av一区二区三区在线 | 风流少妇一区二区| 国产成+人+日韩+欧美+亚洲| 国产精品一卡二卡在线观看| 免费成人在线影院| 精品亚洲porn| 国产精品77777| 成人黄色国产精品网站大全在线免费观看| 国产美女在线精品| 国产成人在线观看免费网站| 国产风韵犹存在线视精品| 国产精品亚洲专一区二区三区| 激情综合亚洲精品| 国产91精品精华液一区二区三区 | 一区二区三区加勒比av| 伊人夜夜躁av伊人久久| 一区二区免费在线播放| 亚洲成av人片观看| 日韩电影在线免费看| 久久精品72免费观看| 国产一区91精品张津瑜| 国产不卡一区视频| 一本色道a无线码一区v| 欧美色图在线观看| 91精品国产一区二区三区蜜臀 | 777xxx欧美| 久久综合九色欧美综合狠狠| 国产视频亚洲色图| 亚洲黄色av一区| 免费成人在线观看视频| 国产电影精品久久禁18| 欧洲一区在线电影| 欧美一级生活片| 中文字幕在线观看一区| 日韩激情视频网站| 福利电影一区二区| 欧美欧美午夜aⅴ在线观看| 日韩你懂的在线播放| 亚洲欧洲成人精品av97| 亚洲成av人片一区二区三区| 国产一区二区三区视频在线播放| 成人黄色小视频| 91麻豆精品国产91久久久| 国产精品你懂的在线| 午夜私人影院久久久久| 国产精品一区二区免费不卡| 在线观看日韩高清av| 久久精品一区二区三区不卡| 亚洲综合一区二区三区| 国产成人a级片|