1
2 /* ###--------------------------------------------------------------### */
3 /* */
4 /* file : cst_error.c */
5 /* date : Dec 24 1994 */
6 /* version : v000 */
7 /* authors : DUNOYER Julien & ABDALLAH Nizar */
8 /* description : system level functions */
9 /* */
10 /* ###--------------------------------------------------------------### */
11
12 #include <stdio.h>
13 #include "mut.h"
14 #include "cst.h"
15
16 /* ###--------------------------------------------------------------### */
17 /* function : cst_error */
18 /* description : print an error message on standard error output */
19 /* called func. : none */
20 /* ###--------------------------------------------------------------### */
21
cst_error(code,str1,str2,dat1)22 void cst_error (code, str1, str2, dat1)
23
24 int code;
25 char *str1;
26 char *str2;
27 int dat1;
28
29 {
30 CST_ERRCNT++;
31 CST_ERRCOD = code;
32 CST_STATUS = CST_ERROR;
33
34 if (((CST_MSGLVL & CST_MSG__ERR) != 0) && ((CST_ERRCNT < CST_MAXERR)))
35 {
36 fprintf (stderr, "Cst Error %d in func. `%s`: ", code, str1);
37
38 switch (code)
39 {
40
41 default:
42 fprintf (stderr,"unknown error: %d\n", code);
43 break;
44 }
45 }
46 if (CST_ERRCNT == CST_MAXERR)
47 fprintf (stderr ,"Too many errors : cant explain them further more");
48 }
49