1 /* XView error handling routines.
2 Copyright (C) 1995 Jakub Jelinek.
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
20 #include <xview/xview.h>
21 #include <xview/frame.h>
22 #include <xview/notice.h>
26 int xv_error_handler (Xv_object object
, Attr_avlist avlist
)
29 Error_severity severity
= ERROR_RECOVERABLE
;
31 char str1
[64], str2
[64], str3
[64], str4
[64], str5
[64], str6
[64], str7
[64];
34 strs
[0] = str1
; strs
[1] = str2
; strs
[2] = str3
; strs
[3] = str4
;
35 strs
[4] = str5
; strs
[5] = str6
; strs
[6] = str7
;
36 for (attrs
= avlist
; *attrs
&& n
< 5; attrs
= attr_next (attrs
)) {
37 switch ((int) attrs
[0]) {
39 sprintf (strs
[n
++], "bad attribute %s",
40 attr_name (attrs
[1]));
43 sprintf (strs
[n
++], "bad value (0x%x) for attribute %s",
44 (int) attrs
[1], attr_name (attrs
[2]));
46 case ERROR_INVALID_OBJECT
:
47 sprintf (strs
[n
++], "invalid object (%s)",
51 sprintf (strs
[n
++], "%s",
55 sprintf (strs
[n
++], "Package: %s",
56 ((Xv_pkg
*) attrs
[1])->name
);
63 strcpy (strs
[n
++], "Dump core?");
66 if (notice_prompt (mcframe
, (Event
*) NULL
,
67 NOTICE_MESSAGE_STRINGS_ARRAY_PTR
, strs
,
68 NOTICE_BUTTON_YES
, "Yes",
69 NOTICE_BUTTON_NO
, "No",
73 if (severity
== ERROR_NON_RECOVERABLE
)