Initial import from FreeBSD RELENG_4:
[games.git] / gnu / lib / libdialog / notify.c
1 /*
2  * File:        notify.c
3  * Author:      Marc van Kempen
4  * Desc:        display a notify box with a message
5  *
6  * Copyright (c) 1995, Marc van Kempen
7  *
8  * All rights reserved.
9  *
10  * This software may be used, modified, copied, distributed, and
11  * sold, in both source and binary form provided that the above
12  * copyright and these terms are retained, verbatim, as the first
13  * lines of this file.  Under no circumstances is the author
14  * responsible for the proper functioning of this software, nor does
15  * the author assume any responsibility for damages incurred with
16  * its use.
17  *
18  */
19
20 #ifndef lint
21 static const char rcsid[] =
22   "$FreeBSD: src/gnu/lib/libdialog/notify.c,v 1.6.12.2 2002/06/18 07:55:55 dougb Exp $";
23 #endif
24
25 #include <dialog.h>
26 #include <stdio.h>
27 #include <stdlib.h>
28
29 void
30 dialog_notify(char *msg)
31 /*
32  * Desc: display an error message
33  */
34 {
35     char *tmphlp;
36     WINDOW *w;
37
38     w = dupwin(newscr);
39     if (w == NULL) {
40         endwin();
41         fprintf(stderr, "\ndupwin(newscr) failed, malloc memory corrupted\n");
42         exit(1);
43     }
44     tmphlp = get_helpline();
45     use_helpline("Press enter or space");
46     dialog_mesgbox("Message", msg, -1, -1);
47     restore_helpline(tmphlp);
48     touchwin(w);
49     wrefresh(w);
50     delwin(w);
51
52     return;
53
54 } /* dialog_notify() */
55