File:  [CSRG BSD Unix] / 43BSDReno / contrib / isode-beta / dsap / common / parse_error.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 16:12:56 2018 UTC (8 years, 1 month ago) by root
Branches: MAIN, BSD
CVS tags: HEAD, BSD43reno
BSD 4.3reno

/* parse_error.c - */

#ifndef	lint
static char *rcsid = "$Header: /var/lib/cvsd/repos/CSRG/43BSDReno/contrib/isode-beta/dsap/common/parse_error.c,v 1.1.1.1 2018/04/24 16:12:56 root Exp $";
#endif

/* 
 * $Header: /var/lib/cvsd/repos/CSRG/43BSDReno/contrib/isode-beta/dsap/common/parse_error.c,v 1.1.1.1 2018/04/24 16:12:56 root Exp $
 *
 *
 * $Log: parse_error.c,v $
 * Revision 1.1.1.1  2018/04/24 16:12:56  root
 * BSD 4.3reno
 *
 * Revision 7.1  90/07/09  14:34:56  mrose
 * sync
 * 
 * Revision 7.0  89/11/23  21:42:37  mrose
 * Release 6.0
 * 
 */

/*
 *				  NOTICE
 *
 *    Acquisition, use, and distribution of this module and related
 *    materials are subject to the restrictions of a license agreement.
 *    Consult the Preface in the User's Manual for the full terms of
 *    this agreement.
 *
 */


/* LINTLIBRARY */

#include "quipu/util.h"
#include "psap.h"

int print_parse_errors = TRUE;
int parse_status = 0;
#ifdef TURBO_DISK
char *parse_entry = NULL;
#endif
PS opt = NULLPS;
int parse_line = 1;
extern LLog * log_dsap;

parse_error (a,b)
char *a, *b;
{
char buffer [LINESIZE];

	parse_status++;

	if (print_parse_errors) {
		if (opt == NULLPS) {
			opt = ps_alloc (std_open);
			if (std_setup (opt,stderr) != OK) {
				LLOG (log_dsap,LLOG_EXCEPTIONS,("cant open error (parse)..."));
				LLOG (log_dsap,LLOG_EXCEPTIONS,(a,b));
				return;
			}
		}
#ifdef TURBO_DISK
		if ( parse_entry != NULL )
			ps_printf(opt, "key (%s): ", parse_entry);
#else
		if (parse_line != 0)
			ps_printf (opt,"line %d: ",parse_line);
#endif
		ps_printf (opt,a,b);
		ps_printf (opt,"\n");
	} else {
#ifdef TURBO_DISK
		if ( parse_entry != NULL ) {
			(void) sprintf (buffer,"key (%s): ", parse_entry);
			(void) strcat (buffer,a);
			LLOG (log_dsap,LLOG_EXCEPTIONS,(buffer,b));
#else
		if (parse_line != 0) {
			(void) sprintf (buffer,"line %d: ",parse_line);
			(void) strcat (buffer,a);
			LLOG (log_dsap,LLOG_EXCEPTIONS,(buffer,b));
#endif
		} else
			LLOG (log_dsap,LLOG_EXCEPTIONS,(a,b));
	}
}

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.