/*
 * 5799-WZQ (C) COPYRIGHT = NONE
 * LICENSED MATERIALS - PROPERTY OF IBM
 */
/* $Header:util.c 12.0$ */
/* $ACIS:util.c 12.0$ */
/* $Source: /ibm/acis/usr/src/nfs/etc/yp/revnetgroup/RCS/util.c,v $ */

#ifndef lint
static char *rcsid = "$Header:util.c 12.0$";
#endif

#include <sys/nfs_defines.h>

/* @(#)util.c	1.3 87/08/13 NFSSRC */
#ifndef lint
static  char sccsid[] = "@(#)util.c 1.1 86/09/25 (C) 1985 Sun Microsystems, Inc.";
/*
 *
 * NFSSRC 3.2/4.3 for the VAX*
 * Copyright (C) 1987 Sun Microsystems, Inc.
 * 
 * (*)VAX is a trademark of Digital Equipment Corporation
 *
 */
#endif

#include <stdio.h>
#include "util.h"




/*
 * This is just like fgets, but recognizes that "\\n" signals a continuation
 * of a line
 */
char *
getline(line,maxlen,fp)
	char *line;
	int maxlen;
	FILE *fp;
{
	register char *p;
	register char *start;


	start = line;

nextline:
	if (fgets(start,maxlen,fp) == NULL) {
		return(NULL);
	}	
	for (p = start; ; p++) {
		if (*p == '\n') {       
			if (*(p-1) == '\\') {
				start = p - 1;
				goto nextline;
			} else {
				return(line);	
			}
		}
	}
}	




	
void
fatal(message)
	char *message;
{
	(void) fprintf(stderr,"fatal error: %s\n",message);
	exit(1);
}

/* 
 * NFSSRC 3.2/4.3 for the VAX*
 * Copyright (C) 1987 Sun Microsystems, Inc.
 * 
 * (*)VAX is a trademark of Digital Equipment Corporation
 */
