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

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

?? tail.c

?? 操作系統(tǒng)源代碼
?? C
字號:
/* tail - copy the end of a file	Author: Norbert Schlenker *//*   Syntax:	tail [-f] [-c number | -n number] [file] *		tail -[number][c|l][f] [file]		(obsolescent) *		tail +[number][c|l][f] [file]		(obsolescent) *   Flags: *	-c number	Measure starting point in bytes.  If number begins *			with '+', the starting point is relative to the *			the file's beginning.  If number begins with '-' *			or has no sign, the starting point is relative to *			the end of the file. *	-f		Keep trying to read after EOF on files and FIFOs. *	-n number	Measure starting point in lines.  The number *			following the flag has significance similar to *			that described for the -c flag. * *   If neither -c nor -n are specified, the default is tail -n 10. * *   In the obsolescent syntax, an argument with a 'c' following the *   (optional) number is equivalent to "-c number" in the standard *   syntax, with number including the leading sign ('+' or '-') of the *   argument.  An argument with 'l' following the number is equivalent *   to "-n number" in the standard syntax.  If the number is not *   specified, 10 is used as the default.  If neither 'c' nor 'l' are *   specified, 'l' is assumed.  The character 'f' may be suffixed to *   the argument and is equivalent to specifying "-f" in the standard *   syntax.  Look for lines marked "OBSOLESCENT". * *   If no file is specified, standard input is assumed.  * *   P1003.2 does not specify tail's behavior when a count of 0 is given. *   It also does not specify clearly whether the first byte (line) of a *   file should be numbered 0 or 1.  Historical behavior is that the *   first byte is actually number 1 (contrary to all Unix standards). *   Historically, a count of 0 (or -0) results in no output whatsoever, *   while a count of +0 results in the entire file being copied (just like *   +1).  The implementor does not agree with these behaviors, but has *   copied them slavishly.  Look for lines marked "HISTORICAL". *    *   Author:    Norbert Schlenker *   Copyright: None.  Released to the public domain. *   Reference: P1003.2 section 4.59 (draft 10) *   Notes:	Under Minix, this program requires chmem =30000. *   Bugs:	No internationalization support; all messages are in English. *//* Force visible Posix names */#ifndef _POSIX_SOURCE#define _POSIX_SOURCE 1#endif/* External interfaces */#include <sys/types.h>#include <sys/stat.h>#include <unistd.h>#include <ctype.h>#include <stdlib.h>#include <stdio.h>/* External interfaces that should have been standardized into <getopt.h> */#ifdef _MINIX_PROTOTYPE(int getopt, (int argc, char **argv, char *options));#elseextern int getopt();#endifextern char *optarg;extern int optind;/* We expect this constant to be defined in <limits.h> in a Posix program, * but we'll specify it here just in case it's been left out. */#ifndef LINE_MAX#define LINE_MAX 2048		/* minimum acceptable lower bound */#endif/* Magic numbers suggested or required by Posix specification */#define SUCCESS	0		/* exit code in case of success */#define FAILURE 1		/*                   or failure */#define DEFAULT_COUNT 10	/* default number of lines or bytes */#define MIN_BUFSIZE (LINE_MAX * DEFAULT_COUNT)#define SLEEP_INTERVAL	1	/* sleep for one second intervals with -f */#define FALSE 0#define TRUE 1/* Internal functions - prototyped under Minix */_PROTOTYPE(int main, (int argc, char **argv));_PROTOTYPE(int tail, (int count, int bytes, int read_until_killed));_PROTOTYPE(int keep_reading, (void));_PROTOTYPE(void usage, (void));int main(argc, argv)int argc;char *argv[];{  int cflag = FALSE;  int nflag = FALSE;  int fflag = FALSE;  int number = -DEFAULT_COUNT;  char *suffix;  int opt;  struct stat stat_buf;/* Determining whether this invocation is via the standard syntax or * via an obsolescent one is a nasty kludge.  Here it is, but there is * no pretense at elegance. */  if (argc == 1) {		/* simple:  default read of a pipe */	exit(tail(-DEFAULT_COUNT, 0, fflag));  }  if ((argv[1][0] == '+') ||	/* OBSOLESCENT */      (argv[1][0] == '-' && ((isdigit(argv[1][1])) ||			     (argv[1][1] == 'l') ||			     (argv[1][1] == 'c' && argv[1][2] == 'f')))) {	--argc; ++argv;	if (isdigit(argv[0][1])) {		number = (int)strtol(argv[0], &suffix, 10);		if (number == 0) {		/* HISTORICAL */			if (argv[0][0] == '+')				number = 1;			else				exit(SUCCESS);		}	} else {		number = (argv[0][0] == '+') ? DEFAULT_COUNT : -DEFAULT_COUNT;		suffix = &(argv[0][1]);	}	if (*suffix != '\0') {		if (*suffix == 'c') {			cflag = TRUE;			++suffix;		}		else		if (*suffix == 'l') {			nflag = TRUE;			++suffix;		}	}	if (*suffix != '\0') {		if (*suffix == 'f') {			fflag = TRUE;			++suffix;		}	}	if (*suffix != '\0') {	/* bad form: assume to be a file name */		number = -DEFAULT_COUNT;		cflag = nflag = FALSE;		fflag = FALSE;	} else {		--argc; ++argv;	}  } else {			/* new standard syntax */	while ((opt = getopt(argc, argv, "c:fn:")) != EOF) {		switch (opt) {		      case 'c':			cflag = TRUE;			if (*optarg == '+' || *optarg == '-')				number = atoi(optarg);			else			if (isdigit(*optarg))				number = -atoi(optarg);			else				usage();			if (number == 0) {		/* HISTORICAL */				if (*optarg == '+')					number = 1;				else					exit(SUCCESS);			}			break;		      case 'f':			fflag = TRUE;			break;		      case 'n':			nflag = TRUE;			if (*optarg == '+' || *optarg == '-')				number = atoi(optarg);			else			if (isdigit(*optarg))				number = -atoi(optarg);			else				usage();			if (number == 0) {		/* HISTORICAL */				if (*optarg == '+')					number = 1;				else					exit(SUCCESS);			}			break;		      default:			usage();			/* NOTREACHED */		}	}	argc -= optind;	argv += optind;  }  if (argc > 1 ||		/* too many arguments */      (cflag && nflag)) {	/* both bytes and lines specified */	usage();  }  if (argc > 0) {		/* an actual file */	if (freopen(argv[0], "r", stdin) != stdin) {		fputs("tail: could not open ", stderr);		fputs(argv[0], stderr);		fputs("\n", stderr);		exit(FAILURE);	}	/* There is an optimization possibility here.  If a file is being	 * read, we need not look at the front of it.  If we seek backwards         * from the end, we can (potentially) avoid looking at most of the	 * file.  Some systems fail when asked to seek backwards to a point	 * before the start of the file, so we avoid that possibility.	 */	if (number < 0 && fstat(fileno(stdin), &stat_buf) == 0) {		long offset = cflag ? (long)number : (long)number * LINE_MAX;		if (-offset < stat_buf.st_size)			fseek(stdin, offset, SEEK_END);	}  } else {	fflag = FALSE;		/* force -f off when reading a pipe */  }  exit(tail(number, cflag, fflag));  /* NOTREACHED */}int tail(count, bytes, read_until_killed)int count;			/* lines or bytes desired */int bytes;			/* TRUE if we want bytes */int read_until_killed;		/* keep reading at EOF */{  int c;  char *buf;			/* pointer to input buffer */  char *buf_end;		/* and one past its end */  char *start;			/* pointer to first desired character in buf */  char *finish;			/* pointer past last desired character */  int wrapped_once = FALSE;	/* TRUE after buf has been filled once *//* This is magic.  If count is positive, it means start at the count'th * line or byte, with the first line or byte considered number 1.  Thus, * we want to SKIP one less line or byte than the number specified.  In * the negative case, we look backward from the end of the file for the * (count + 1)'th newline or byte, so we really want the count to be one * LARGER than was specified (in absolute value).  In either case, the * right thing to do is: */  --count;/* Count is positive:  skip the desired lines or bytes and then copy. */  if (count >= 0) {	while (count > 0 && (c = getchar()) != EOF) {		if (bytes || c == '\n')			--count;	}	while ((c = getchar()) != EOF) {		if (putchar(c) == EOF)			return FAILURE;	}	if (read_until_killed)		return keep_reading();	return ferror(stdin) ? FAILURE : SUCCESS;  }/* Count is negative:  allocate a reasonably large buffer. */  if ((buf = (char *)malloc(MIN_BUFSIZE + 1)) == (char *)NULL) {	fputs("tail: out of memory\n", stderr);	return FAILURE;  }  buf_end = buf + (MIN_BUFSIZE + 1);/* Read the entire file into the buffer. */  finish = buf;  while ((c = getchar()) != EOF) {	*finish++ = c;	if (finish == buf_end) {		finish = buf;		wrapped_once = TRUE;	}  }  if (ferror(stdin))	return FAILURE;/* Back up inside the buffer.  The count has already been adjusted to * back up exactly one character too far, so we will bump the buffer * pointer once after we're done. *  * BUG: For large line counts, the buffer may not be large enough to *	hold all the lines.  The specification allows the program to *	fail in such a case - this program will simply dump the entire *	buffer's contents as its best attempt at the desired behavior. */  if (finish != buf || wrapped_once) {		/* file was not empty */	start = (finish == buf) ? buf_end - 1 : finish - 1;	while (start != finish) {		if ((bytes || *start == '\n') && ++count == 0)			break;		if (start == buf) {			start = buf_end - 1;			if (!wrapped_once)	/* never wrapped: stop now */				break;		} else {			--start;		}	}	if (++start == buf_end) {		/* bump after going too far */		start = buf;	}	if (finish > start) {		fwrite(start, 1, finish - start, stdout);	} else {		fwrite(start, 1, buf_end - start, stdout);		fwrite(buf, 1, finish - buf, stdout);	}  }  if (read_until_killed)	return keep_reading();  return ferror(stdout) ? FAILURE : SUCCESS;}/* Wake at intervals to reread standard input.  Copy anything read to * standard output and then go to sleep again. */int keep_reading(){  int c;  for (;;) {	sleep(SLEEP_INTERVAL);	clearerr(stdin);	while ((c = getchar()) != EOF) {		if (putchar(c) == EOF)			return FAILURE;	}	if (ferror(stdin))		return FAILURE;  }}/* Tell the user the standard syntax. */void usage(){  fputs("Usage: tail [-f] [-c number | -n number] [file]\n", stderr);  exit(FAILURE);}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩精品中文字幕一区二区三区| 久久精品二区亚洲w码| proumb性欧美在线观看| 国产精品国产馆在线真实露脸| 国产成人av自拍| 国产欧美一二三区| 色综合天天综合网国产成人综合天 | 中文字幕亚洲区| 91丨九色丨国产丨porny| 一区二区三区中文字幕在线观看| 欧洲精品一区二区| 久久精品国产成人一区二区三区 | 国产高清精品在线| 中文字幕一区二区在线观看| 欧洲精品一区二区三区在线观看| 亚洲成人av一区二区三区| 日韩欧美国产一区二区在线播放| 国产一区激情在线| 亚洲三级在线看| 欧美一区二区福利视频| 成人性生交大合| 亚洲国产一二三| 久久色在线观看| 色域天天综合网| 麻豆精品蜜桃视频网站| 国产精品视频第一区| 欧美日韩国产综合草草| 国产一区二区在线电影| 一区二区三区日韩在线观看| 亚洲精品一区二区三区精华液 | 久久免费国产精品| 9色porny自拍视频一区二区| 天堂久久久久va久久久久| 国产亚洲综合av| 91精彩视频在线观看| 欧美一区二区三区婷婷月色| 亚洲日本护士毛茸茸| 精品一区二区三区不卡| 一本大道久久a久久精品综合| 精品国产乱码久久久久久免费| 国产精品久久久久久妇女6080 | 亚洲精品日韩专区silk| 亚洲黄一区二区三区| 激情av综合网| 久久九九久久九九| 亚洲成人精品在线观看| 94-欧美-setu| 亚洲专区一二三| 色婷婷国产精品综合在线观看| 精品国产乱码久久久久久蜜臀| 日本欧美在线看| 欧美日韩不卡一区二区| 午夜视频在线观看一区二区三区| 欧美日韩一区二区三区四区五区 | 欧美亚洲综合色| 久久先锋影音av| 亚洲一区二区3| 国产一区二区免费看| 久久综合色之久久综合| 成人在线综合网站| 国内外成人在线视频| 成人性生交大片免费看视频在线 | 成人免费高清在线观看| 五月天激情综合| 亚洲精品国产一区二区精华液| 国产婷婷一区二区| 精品免费视频一区二区| 在线成人免费观看| 欧美伦理视频网站| 精品视频免费看| 欧美性猛交xxxxxx富婆| 色婷婷综合久久久| 日韩精品中文字幕一区| 3d动漫精品啪啪| 4438成人网| 欧美一二三区在线观看| 欧美二区三区的天堂| 欧美高清hd18日本| 91精品国产一区二区三区蜜臀 | 亚洲一区二区不卡免费| 一区二区免费视频| 亚洲乱码精品一二三四区日韩在线| 国产精品国产成人国产三级 | 久久精品一级爱片| 久久免费国产精品| 国产精品嫩草影院av蜜臀| 国产精品美女视频| 综合久久给合久久狠狠狠97色| 亚洲精品视频在线观看网站| 一区二区三区日韩欧美| 天堂久久一区二区三区| 久久99精品久久久| 处破女av一区二区| 色综合久久久久| 欧美日本国产视频| 久久这里都是精品| 日韩一区中文字幕| 亚洲综合视频在线观看| 青青青伊人色综合久久| 国产真实乱对白精彩久久| 成人av在线资源| 欧美挠脚心视频网站| 欧美成人女星排名| 国产精品午夜在线| 五月激情综合婷婷| 国产伦精一区二区三区| 色婷婷av一区| 精品免费视频.| 亚洲免费观看在线观看| 日韩成人一级片| 欧美三日本三级三级在线播放| 欧美乱熟臀69xxxxxx| 国产日韩v精品一区二区| 一区二区三区在线不卡| 免费看日韩a级影片| av在线不卡观看免费观看| 欧美日韩中文字幕一区二区| 2021国产精品久久精品| 尤物视频一区二区| 国产在线一区二区综合免费视频| 色综合久久久久综合99| 精品国产91久久久久久久妲己| 成人免费一区二区三区视频| 免费国产亚洲视频| 一本到三区不卡视频| 欧美精品一区视频| 亚洲福利视频三区| www.欧美亚洲| 欧美r级在线观看| 亚洲国产视频在线| 波多野结衣的一区二区三区| 精品少妇一区二区三区免费观看 | 国产精品午夜春色av| 天天免费综合色| 成人av在线一区二区| 精品美女一区二区三区| 亚洲小说欧美激情另类| 成人污污视频在线观看| 制服丝袜亚洲色图| 亚洲乱码一区二区三区在线观看| 国产精品99久久久久久久vr| 欧美一三区三区四区免费在线看| 亚洲天堂a在线| 国产91丝袜在线观看| 精品日韩一区二区三区| 色综合天天综合网天天狠天天| 精品国产一区二区亚洲人成毛片| 香蕉久久夜色精品国产使用方法| 91视频免费播放| 国产精品美日韩| 国产精品主播直播| 久久久亚洲欧洲日产国码αv| 日本va欧美va欧美va精品| 91国偷自产一区二区开放时间 | 色狠狠一区二区三区香蕉| 国产欧美精品在线观看| 国产美女精品在线| 欧美成人精品二区三区99精品| 婷婷久久综合九色综合伊人色| 欧美在线一区二区| 亚洲精品国产高清久久伦理二区| 99久久免费视频.com| 国产精品久久久久aaaa樱花| 国产suv精品一区二区三区| 久久久99免费| 国产福利91精品一区| 久久久久国产成人精品亚洲午夜| 美腿丝袜亚洲综合| 精品免费日韩av| 国产激情视频一区二区三区欧美 | 国产午夜精品一区二区三区视频| 极品瑜伽女神91| 久久久精品免费观看| 国产高清在线观看免费不卡| 国产欧美日韩一区二区三区在线观看| 国产精品主播直播| 国产精品久久久久久久久免费相片 | 中文字幕精品—区二区四季| 国产一区美女在线| 国产精品私房写真福利视频| jlzzjlzz欧美大全| 夜夜精品浪潮av一区二区三区 | 26uuu国产一区二区三区| 国产一区二区三区久久久 | 成人午夜激情视频| 亚洲欧美激情在线| 欧美日韩国产欧美日美国产精品| 免费精品视频在线| 欧美激情一区二区三区四区| 91亚洲精品一区二区乱码| 一个色在线综合| 日韩一区二区三区四区五区六区| 狠狠色2019综合网| 国产精品久久久久久久久快鸭| 色网站国产精品| 日本欧美在线观看| 国产精品国产三级国产专播品爱网| 色94色欧美sute亚洲线路一久| 奇米影视7777精品一区二区| 国产欧美一区二区精品秋霞影院|