⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 add_entry.c

📁 操作系统SunOS 4.1.3版本的源码
💻 C
字号:
/*      @(#)add_entry.c 1.1 92/07/30 SMI                              *//* * Copyright (c) 1988 by Sun Microsystems, Inc. */#include "stdio.h"intadd_entry(new_entry, file, progname)char *new_entry, *file, *progname;{	int 	add_flag=0;	char	file_entry[BUFSIZ];	FILE 	*fp;	/* check local file */	if (getfileent(new_entry, file_entry, file) == 0) {		/* there is a local entry - see if it matches */		/* if not replace it - if matches return */	} else {		/* no entry so write one in */		if (fp = fopen(file, "a")) {			(void) fprintf(fp, new_entry);			(void) fprintf(fp, "\n");			(void) fclose(fp);			add_flag++;		} else {			(void) fprintf(stderr,"%s:\tcannot open %s\n",			    progname, file);			(void) fprintf(stderr,"\t%s entry not made\n", new_entry);		}	}	return(add_flag);}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -