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

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

?? pac.c

?? <B>Digital的Unix操作系統(tǒng)VAX 4.2源碼</B>
?? C
字號:
#ifndef lintstatic char *sccsid = "@(#)pac.c	4.1      ULTRIX 7/2/90";#endif/************************************************************************ *									* *			Copyright (c) 1988 by				* *		Digital Equipment Corporation, Maynard, MA		* *			All rights reserved.				* *									* *   This software is furnished under a license and may be used and	* *   copied  only  in accordance with the terms of such license and	* *   with the  inclusion  of  the  above  copyright  notice.   This	* *   software  or  any  other copies thereof may not be provided or	* *   otherwise made available to any other person.  No title to and	* *   ownership of the software is hereby transferred.			* *									* *   This software is  derived  from  software  received  from  the	* *   University    of   California,   Berkeley,   and   from   Bell	* *   Laboratories.  Use, duplication, or disclosure is  subject  to	* *   restrictions  under  license  agreements  with  University  of	* *   California and with AT&T.						* *									* *   The information in this software is subject to change  without	* *   notice  and should not be construed as a commitment by Digital	* *   Equipment Corporation.						* *									* *   Digital assumes no responsibility for the use  or  reliability	* *   of its software on equipment which is not supplied by Digital.	* *									* ************************************************************************//* * pac.c -- Do Printer accounting summary. * Currently, usage is *	pac [-Pprinter] [-pprice] [-s] [-r] [-c] [user ...] * to print the usage information for the named people. *//* SCCS history beginning * *************************************************************** *                -- Revision History -- * *************************************************************** *  * 1.1  01/11/83 -- sccs * date and time created 83/11/01 20:58:26 by sccs *  * *************************************************************** * * 1.2  19/07/88 -- thoms * Added copyright notice and modification history * * SCCS history end */#include <stdio.h>#include "lp.local.h"char	*printer;			/* printer name */char	*acctfile;			/* accounting file (input data) */char	*sumfile;			/* summary file */float	price = 0.02;			/* cost per page (or what ever) */int	allflag = 1;			/* Get stats on everybody */int	sort;				/* Sort by cost */int	summarize;			/* Compress accounting file */int	reverse;			/* Reverse sort order */int	hcount;				/* Count of hash entries */int	errs;/* * Grossness follows: *  Names to be accumulated are hashed into the following *  table. */#define	HSHSIZE	97			/* Number of hash buckets */struct hent {	struct	hent *h_link;		/* Forward hash link */	char	*h_name;		/* Name of this user */	float	h_feetpages;		/* Feet or pages of paper */	int	h_count;		/* Number of runs */};struct	hent	*hashtab[HSHSIZE];	/* Hash table proper */struct	hent	*enter();struct	hent	*lookup();#define	NIL	((struct hent *) 0)	/* The big zero */double	atof();char	*getenv();char	*pgetstr();main(argc, argv)	char **argv;{	register FILE *acct;	register char *cp;	while (--argc) {		cp = *++argv;		if (*cp++ == '-') {			switch(*cp++) {			case 'P':				/*				 * Printer name.				 */				printer = cp;				continue;			case 'p':				/*				 * get the price.				 */				price = atof(cp);				continue;			case 's':				/*				 * Summarize and compress accounting file.				 */				summarize++;				continue;			case 'c':				/*				 * Sort by cost.				 */				sort++;				continue;			case 'r':				/*				 * Reverse sorting order.				 */				reverse++;				continue;			default:fprintf(stderr, "usage: pac [-Pprinter] [-pprice] [-s] [-c] [-r] [user ...]\n");				exit(1);			}		}		(void) enter(--cp);		allflag = 0;	}	if (printer == NULL && (printer = getenv("PRINTER")) == NULL)		printer = DEFLP;	if (!chkprinter(printer)) {		printf("pac: unknown printer %s\n", printer);		exit(2);	}	if ((acct = fopen(acctfile, "r")) == NULL) {		perror(acctfile);		exit(1);	}	account(acct);	fclose(acct);	if ((acct = fopen(sumfile, "r")) != NULL) {		account(acct);		fclose(acct);	}	if (summarize)		rewrite();	else		dumpit();	exit(errs);}/* * Read the entire accounting file, accumulating statistics * for the users that we have in the hash table.  If allflag * is set, then just gather the facts on everyone. * Note that we must accomodate both the active and summary file * formats here. */account(acct)	register FILE *acct;{	char linebuf[BUFSIZ];	double t;	register char *cp, *cp2;	register struct hent *hp;	register int ic;	while (fgets(linebuf, BUFSIZ, acct) != NULL) {		cp = linebuf;		while (any(*cp, " t\t"))			cp++;		t = atof(cp);		while (any(*cp, ".0123456789"))			cp++;		while (any(*cp, " \t"))			cp++;		for (cp2 = cp; !any(*cp2, " \t\n"); cp2++)			;		ic = atoi(cp2);		*cp2 = '\0';		hp = lookup(cp);		if (hp == NIL) {			if (!allflag)				continue;			hp = enter(cp);		}		hp->h_feetpages += t;		if (ic)			hp->h_count += ic;		else			hp->h_count++;	}}/* * Sort the hashed entries by name or footage * and print it all out. */dumpit(){	struct hent **base;	register struct hent *hp, **ap;	register int hno, c, runs;	float feet;	int qucmp();	hp = hashtab[0];	hno = 1;	base = (struct hent **) calloc(sizeof hp, hcount);	for (ap = base, c = hcount; c--; ap++) {		while (hp == NIL)			hp = hashtab[hno++];		*ap = hp;		hp = hp->h_link;	}	qsort(base, hcount, sizeof hp, qucmp);	printf("  Login               pages/feet   runs    price\n");	feet = 0.0;	runs = 0;	for (ap = base, c = hcount; c--; ap++) {		hp = *ap;		runs += hp->h_count;		feet += hp->h_feetpages;		printf("%-24s %7.2f %4d   $%6.2f\n", hp->h_name,		    hp->h_feetpages, hp->h_count, hp->h_feetpages * price);	}	if (allflag) {		printf("\n");		printf("%-24s %7.2f %4d   $%6.2f\n", "total", feet, 		    runs, feet * price);	}}/* * Rewrite the summary file with the summary information we have accumulated. */rewrite(){	register struct hent *hp;	register int i;	register FILE *acctf;	if ((acctf = fopen(sumfile, "w")) == NULL) {		perror(sumfile);		errs++;		return;	}	for (i = 0; i < HSHSIZE; i++) {		hp = hashtab[i];		while (hp != NULL) {			fprintf(acctf, "%7.2f\t%s\t%d\n", hp->h_feetpages,			    hp->h_name, hp->h_count);			hp = hp->h_link;		}	}	fflush(acctf);	if (ferror(acctf)) {		perror(sumfile);		errs++;	}	fclose(acctf);	if ((acctf = fopen(acctfile, "w")) == NULL)		perror(acctfile);	else		fclose(acctf);}/* * Hashing routines. *//* * Enter the name into the hash table and return the pointer allocated. */struct hent *enter(name)	char name[];{	register struct hent *hp;	register int h;	if ((hp = lookup(name)) != NIL)		return(hp);	h = hash(name);	hcount++;	hp = (struct hent *) calloc(sizeof *hp, 1);	hp->h_name = (char *) calloc(sizeof(char), strlen(name)+1);	strcpy(hp->h_name, name);	hp->h_feetpages = 0.0;	hp->h_count = 0;	hp->h_link = hashtab[h];	hashtab[h] = hp;	return(hp);}/* * Lookup a name in the hash table and return a pointer * to it. */struct hent *lookup(name)	char name[];{	register int h;	register struct hent *hp;	h = hash(name);	for (hp = hashtab[h]; hp != NIL; hp = hp->h_link)		if (strcmp(hp->h_name, name) == 0)			return(hp);	return(NIL);}/* * Hash the passed name and return the index in * the hash table to begin the search. */hash(name)	char name[];{	register int h;	register char *cp;	for (cp = name, h = 0; *cp; h = (h << 2) + *cp++)		;	return((h & 0x7fffffff) % HSHSIZE);}/* * Other stuff */any(ch, str)	char str[];{	register int c = ch;	register char *cp = str;	while (*cp)		if (*cp++ == c)			return(1);	return(0);}/* * The qsort comparison routine. * The comparison is ascii collating order * or by feet of typesetter film, according to sort. */qucmp(left, right)	struct hent **left, **right;{	register struct hent *h1, *h2;	register int r;	h1 = *left;	h2 = *right;	if (sort)		r = h1->h_feetpages < h2->h_feetpages ? -1 : h1->h_feetpages > h2->h_feetpages;	else		r = strcmp(h1->h_name, h2->h_name);	return(reverse ? -r : r);}/* * Perform lookup for printer name or abbreviation -- */chkprinter(s)	register char *s;{	static char buf[BUFSIZ/2];	char b[BUFSIZ];	int stat;	char *bp = buf;	if ((stat = pgetent(b, s)) < 0) {		printf("pac: can't open printer description file\n");		exit(3);	} else if (stat == 0)		return(0);	if ((acctfile = pgetstr("af", &bp)) == NULL) {		printf("accounting not enabled for printer %s\n", printer);		exit(2);	}	sumfile = (char *) calloc(sizeof(char), strlen(acctfile)+5);	if (sumfile == NULL) {		perror("pac");		exit(1);	}	strcpy(sumfile, acctfile);	strcat(sumfile, "_sum");	return(1);}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
97se亚洲国产综合自在线不卡| 久久99精品久久久久久国产越南 | 麻豆精品国产91久久久久久| 欧美日韩在线播放三区四区| 国产亚洲一区二区三区在线观看| 男男视频亚洲欧美| 91精品欧美久久久久久动漫| 岛国av在线一区| 亚洲国产一区二区a毛片| 欧美色综合网站| 夜夜亚洲天天久久| 成人午夜精品在线| 精品少妇一区二区| 亚洲成av人片www| 国产激情一区二区三区四区| 在线区一区二视频| 久久久99久久| 国产一区视频导航| 欧美一级专区免费大片| 久久看人人爽人人| 亚洲不卡av一区二区三区| 激情亚洲综合在线| 从欧美一区二区三区| 日韩欧美国产成人一区二区| 2021中文字幕一区亚洲| 亚洲国产日韩a在线播放| 日韩欧美国产不卡| 亚洲免费毛片网站| 久久免费国产精品| 亚洲美女少妇撒尿| 91视频.com| 亚洲欧美电影院| 成人h动漫精品| 26uuu国产在线精品一区二区| 成人aa视频在线观看| 日韩专区在线视频| 亚洲午夜一区二区| 国产精品婷婷午夜在线观看| 日韩精品在线网站| 91首页免费视频| 国产成人午夜片在线观看高清观看| 亚洲一区二区欧美激情| 中文字幕一区日韩精品欧美| 日韩精品一区二区三区在线| 色哟哟一区二区在线观看| 日韩精品高清不卡| 国产午夜精品久久久久久久 | 美日韩一区二区| 7799精品视频| 成人动漫一区二区三区| 一区二区三区久久| 欧美成人bangbros| 色先锋aa成人| 国产一区在线看| 亚洲靠逼com| 91精品国产综合久久久蜜臀粉嫩 | 国产成人免费视频网站| 免费xxxx性欧美18vr| 色婷婷综合久色| 久久er99热精品一区二区| 中文字幕一区二区三区四区| 欧美日韩大陆在线| 欧洲国内综合视频| 免费黄网站欧美| 91在线精品一区二区三区| 欧美色图激情小说| 精品处破学生在线二十三| 久久青草欧美一区二区三区| 国产精品久久久久久久久久久免费看 | 国产精品视频麻豆| 久久九九99视频| 日韩欧美中文字幕精品| 色综合久久中文字幕| av在线一区二区三区| 成人性生交大片免费看在线播放 | 亚洲激情自拍视频| 91精品国产综合久久久蜜臀图片 | 日韩视频免费观看高清完整版在线观看| 老司机精品视频线观看86| 中文一区在线播放| 2欧美一区二区三区在线观看视频| www.色精品| 欧美性受xxxx| 国产精品卡一卡二| 久久er99精品| 亚洲理论在线观看| 91精品久久久久久蜜臀| 欧美aaa在线| 麻豆成人久久精品二区三区红 | 在线观看91视频| 日韩黄色免费电影| 中文子幕无线码一区tr| 日韩美女一区二区三区| 在线播放亚洲一区| 日韩一区二区三区在线视频| 国产91清纯白嫩初高中在线观看| 亚洲精品成人天堂一二三| 日韩一区二区影院| 欧美高清视频一二三区| 精品处破学生在线二十三| 欧美狂野另类xxxxoooo| 国产精品福利av | 一区二区三区在线观看国产| 欧美一区二区性放荡片| 亚洲激情男女视频| 欧美精选午夜久久久乱码6080| 中文字幕国产一区二区| 精品一区二区久久久| 91麻豆精品国产| 青青草97国产精品免费观看 | 美女尤物国产一区| 日韩欧美在线网站| 国产一区二区三区免费在线观看| 欧美哺乳videos| 国产不卡高清在线观看视频| 久久夜色精品国产欧美乱极品| 亚洲美女少妇撒尿| 美女精品一区二区| 成人v精品蜜桃久久一区| 欧美国产日产图区| 久久99精品久久久久婷婷| 欧美日韩一级片网站| 亚洲一本大道在线| 91 com成人网| 国精产品一区一区三区mba桃花| 日韩美女视频在线| 国产一区二区电影| 日本一区二区三区四区| 日本韩国欧美一区| 蜜桃久久久久久| 日韩一区二区在线观看| 亚洲国产成人av| 91免费在线看| 国产午夜久久久久| 日韩欧美成人激情| 色噜噜偷拍精品综合在线| 欧美另类videos死尸| 欧美日韩一区高清| 中文子幕无线码一区tr| 婷婷六月综合网| 国产一区二区三区黄视频 | 久久精品99国产精品| 久久久精品国产99久久精品芒果| 欧美日韩高清一区二区三区| 国产不卡免费视频| 99视频超级精品| 9l国产精品久久久久麻豆| 99热国产精品| 成人av中文字幕| av影院午夜一区| 91视视频在线观看入口直接观看www | 欧美日韩三级视频| 免费成人性网站| 精品卡一卡二卡三卡四在线| 国产精品亚洲人在线观看| 亚洲三级免费观看| 欧美一二区视频| 欧美在线免费观看亚洲| 极品美女销魂一区二区三区 | 国产一区二区三区久久久| 久久综合久久久久88| 在线一区二区视频| 成人精品免费看| 亚洲人成网站影音先锋播放| 日韩欧美不卡在线观看视频| 欧美偷拍一区二区| 欧美xxxxxxxx| 欧美成人r级一区二区三区| 久久国产精品一区二区| 成人欧美一区二区三区在线播放| 色综合天天综合网国产成人综合天| 国产精品传媒在线| 久久久久久一二三区| 极品少妇xxxx偷拍精品少妇| 亚洲国产精品久久不卡毛片| 久久精品一区八戒影视| 欧美极品另类videosde| 亚洲精品在线电影| 国产欧美视频一区二区| 国产精品美女久久福利网站| 亚洲国产成人午夜在线一区 | 国产精品黄色在线观看| 五月激情六月综合| 粉嫩aⅴ一区二区三区四区| 91黄色在线观看| 国产精品国产三级国产aⅴ入口| 天天综合色天天| 日本道色综合久久| 欧美国产精品专区| 免费亚洲电影在线| 欧美二区乱c少妇| 自拍偷拍国产精品| 97久久精品人人澡人人爽| 久久综合色天天久久综合图片| 午夜电影一区二区三区| 91亚洲精品乱码久久久久久蜜桃 | 91久久国产最好的精华液| 色欧美乱欧美15图片| 日韩女优制服丝袜电影| 日韩理论片一区二区|