]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - gnu/lib/libodialog/notify.c
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / gnu / lib / libodialog / 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 #include <sys/cdefs.h>
21 __FBSDID("$FreeBSD$");
22
23 #include <dialog.h>
24 #include <stdio.h>
25 #include <stdlib.h>
26
27 void
28 dialog_notify(char *msg)
29 /*
30  * Desc: display an error message
31  */
32 {
33     char *tmphlp;
34     WINDOW *w;
35
36     w = dupwin(newscr);
37     if (w == NULL) {
38         endwin();
39         fprintf(stderr, "\ndupwin(newscr) failed, malloc memory corrupted\n");
40         exit(1);
41     }
42     tmphlp = get_helpline();
43     use_helpline("Press enter or space");
44     dialog_mesgbox("Message", msg, -1, -1);
45     restore_helpline(tmphlp);
46     touchwin(w);
47     wrefresh(w);
48     delwin(w);
49
50     return;
51
52 } /* dialog_notify() */
53