static char *SccsId = "@(#)slserr.cls 4.7 (TU-Delft) 12/15/92";
/**********************************************************

Name/Version      : sls_mkdb/4.7

Language          : C
Operating system  : UNIX SYSTEM V
Host machine      : HP9000

Author(s)         : A.C. de Graaf
Creation date     : 10-Jul-1986
Modified by       : S. de Graaf
Modification date : 10-Jul-1986


        Delft University of Technology
        Department of Electrical Engineering
        Network Theory Section
        Mekelweg 4 - P.O.Box 5031
        2600 GA DELFT
        The Netherlands

        Phone : 015 - 786234

        COPYRIGHT (C) 1986 , All rights reserved
**********************************************************/
#include "sys_incl.h"
extern char fn_incl[];
int sls_errcnt;
int sls_errno;
int sls_nerr = 22;

char *sls_errlist[] = {
    0,
    "errors in network definition",
    "actual terminals < formal terminals",
    "actual terminals > formal terminals",
    "destination net < source net",
    "destination net > source net",
    "syntax error",
    "illegal range",
    "terminal already defined",
    "unknown type",
    "illegal network",
    "instance already defined",
    "unknown network",
    "undefined function",
    "network already referenced, defined or declared",
    "unknown terminal",
    "unknown device",
    "failed to make or use equivalent circuit",
    "unknown terminal",
    "inconsistent range for terminal",
    "not specified as a network or extern network",
    "sorry, network names starting with a capital are not allowed",
    0
};

void sls_perror (s)
char   *s;
{
    if (s && *s != '\0')
	fprintf (stderr, "%s: ", s);

    if (sls_errno > 0 && sls_errno <= sls_nerr)
	fprintf (stderr, "%s", sls_errlist[sls_errno]);
    else
	fprintf (stderr, "SLS_MKDB error number: %d", sls_errno);
}

void sls_error(lineno, e_no, e_str)
int lineno;
int e_no;
char * e_str;
{
    char linenostr[16];

    if (fn_incl[0] != '\0')
        fprintf(stderr,"\"%s\", ", fn_incl);

    if(lineno)
        sprintf(linenostr,"line %d", lineno);

    sls_errno = e_no;

    sls_perror(linenostr);

    if(e_str && *e_str)
        fprintf(stderr,"; %s", e_str);

    fprintf(stderr,"\n");
}
