386BSD 0.1 development
[unix-history] / usr / othersrc / contrib / isode / dsap / common / parse_error.c
CommitLineData
04c6839a
WJ
1/* parse_error.c - */
2
3#ifndef lint
4static char *rcsid = "$Header: /f/osi/dsap/common/RCS/parse_error.c,v 7.2 91/02/22 09:19:53 mrose Interim $";
5#endif
6
7/*
8 * $Header: /f/osi/dsap/common/RCS/parse_error.c,v 7.2 91/02/22 09:19:53 mrose Interim $
9 *
10 *
11 * $Log: parse_error.c,v $
12 * Revision 7.2 91/02/22 09:19:53 mrose
13 * Interim 6.8
14 *
15 * Revision 7.1 90/07/09 14:34:56 mrose
16 * sync
17 *
18 * Revision 7.0 89/11/23 21:42:37 mrose
19 * Release 6.0
20 *
21 */
22
23/*
24 * NOTICE
25 *
26 * Acquisition, use, and distribution of this module and related
27 * materials are subject to the restrictions of a license agreement.
28 * Consult the Preface in the User's Manual for the full terms of
29 * this agreement.
30 *
31 */
32
33
34/* LINTLIBRARY */
35
36#include "quipu/util.h"
37#include "psap.h"
38
39int print_parse_errors = TRUE;
40int parse_status = 0;
41#ifdef TURBO_DISK
42char *parse_entry = NULL;
43#endif
44PS opt = NULLPS;
45int parse_line = 1;
46extern LLog * log_dsap;
47
48parse_error (a,b)
49char *a, *b;
50{
51char buffer [LINESIZE];
52
53 parse_status++;
54
55 if (print_parse_errors) {
56 if (opt == NULLPS) {
57 opt = ps_alloc (std_open);
58 if (std_setup (opt,stderr) != OK) {
59 LLOG (log_dsap,LLOG_EXCEPTIONS,("cant open error (parse)..."));
60 LLOG (log_dsap,LLOG_EXCEPTIONS,(a,b));
61 return;
62 }
63 }
64#ifdef TURBO_DISK
65 if ( parse_entry != NULL )
66 ps_printf(opt, "key (%s): ", parse_entry);
67#else
68 if (parse_line != 0)
69 ps_printf (opt,"line %d: ",parse_line);
70#endif
71 ps_printf (opt,a,b);
72 ps_printf (opt,"\n");
73 } else {
74#ifdef TURBO_DISK
75 if ( parse_entry != NULL ) {
76 (void) sprintf (buffer,"key (%s): ", parse_entry);
77 (void) strcat (buffer,a);
78 LLOG (log_dsap,LLOG_EXCEPTIONS,(buffer,b));
79#else
80 if (parse_line != 0) {
81 (void) sprintf (buffer,"line %d: ",parse_line);
82 (void) strcat (buffer,a);
83 LLOG (log_dsap,LLOG_EXCEPTIONS,(buffer,b));
84#endif
85 } else
86 LLOG (log_dsap,LLOG_EXCEPTIONS,(a,b));
87 }
88}