File: fwarn.c

package info (click to toggle)
ion2 20040729-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 2,816 kB
  • ctags: 3,434
  • sloc: ansic: 28,432; makefile: 473; sh: 230; perl: 16
file content (61 lines) | stat: -rw-r--r-- 1,291 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/*
 * ion/query/query.c
 *
 * Copyright (c) Tuomo Valkonen 1999-2004. 
 *
 * Ion is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation; either version 2.1 of the License, or
 * (at your option) any later version.
 */


#include <ioncore/common.h>
#include <ioncore/global.h>
#include <ioncore/focus.h>
#include <ioncore/genframe.h>
#include <ioncore/objp.h>
#include "wmessage.h"
#include "fwarn.h"


/*EXTL_DOC
 * Display an error message box in the multiplexer \var{mplex}.
 */
EXTL_EXPORT
WMessage *query_fwarn(WMPlex *mplex, const char *p)
{
    char *p2;
    WMessage *wmsg;
    
    if(p==NULL)
        return NULL;
    
    p2=scat("Error:\n", p);
    
    if(p2==NULL){
        warn_err();
        return NULL;
    }
    
    wmsg=query_message(mplex, p2);
    
    free(p2);
    
    return wmsg;
}

/*EXTL_DOC
 * Display a message in the \var{mplex}.
 */
EXTL_EXPORT
WMessage *query_message(WMPlex *mplex, const char *p)
{
    if(p==NULL || mplex_current_input(mplex)!=NULL)
        return NULL;

    return (WMessage*)mplex_add_input(mplex,
                                      (WRegionAttachHandler*)create_wmsg,
                                      (void*)p);
}