Debian Codegraph @

gui/GraphLib/libsrc/uimxR5/src/t_error.c

raw
1 /*---------------------------------------------------------------------
2 * $Date: 2009-08-18 15:23:20 $ $Revision: 1.3 $
3 *---------------------------------------------------------------------
4 *
5 *
6 * Copyright (c) 1992, Visual Edge Software Ltd.
7 *
8 * ALL RIGHTS RESERVED. Permission to use, copy, modify, and
9 * distribute this software and its documentation for any purpose
10 * and without fee is hereby granted, provided that the above
11 * copyright notice appear in all copies and that both that
12 * copyright notice and this permission notice appear in supporting
13 * documentation, and that the name of Visual Edge Software not be
14 * used in advertising or publicity pertaining to distribution of
15 * the software without specific, written prior permission. The year
16 * included in the notice is the year of the creation of the work.
17
18 .VERSION
19 090818 last modif
20
21 *-------------------------------------------------------------------*/
22
23 #include <stdlib.h>
24 #include <stdio.h>
25
26 #include "t_error.h"
27 #include "uimx_cat.h"
28 #include "lib_ds.h"
29 #define CGETS(x,y) UxCatGets(MC_LIBUIMX,(x),(y))
30 extern char *UxCopyString();
31
32 static char *Instances,*MallocFailed,*ReallocFailed,*Undefined;
33
34 void UxErrorHandler(error,type,where)
35 int error,type;
36 char *where;
37 {
38 switch(error){
39 case INSTANCES_EXCEEDED:
40 printf(Instances,where);
41 break;
42 case MALLOC_FAILED:
43 printf(MallocFailed,where);
44 break;
45 case REALLOC_FAILED:
46 printf(ReallocFailed,where);
47 break;
48 default:
49 printf(Undefined,where);
50 break;
51 }
52 if(type == FATAL)
53 exit(error);
54 }
55
56
57 void UxInitErrorHandler()
58 {
59 Instances = UxCopyString(CGETS(MS_LU_INSTEXCEEDED,DS_MS_LU_INSTEXCEEDED));
60 MallocFailed = UxCopyString(CGETS(MS_LU_MALLOCFAILED,DS_MS_LU_MALLOCFAILED));
61 ReallocFailed = UxCopyString(CGETS(MS_LU_REALLOCFAILED,DS_MS_LU_REALLOCFAILED));
62 Undefined = UxCopyString(CGETS(MS_LU_UNDEFERROR,DS_MS_LU_UNDEFERROR));
63 }
64
65
66
67
68