author | Lluís Batlle <viric@viric.name> |
Thu, 20 Mar 2014 16:33:27 +0100 | |
changeset 97 | eea77d5a624c |
parent 82 | 5cbe47923060 |
permissions | -rw-r--r-- |
12 | 1 |
/* |
53 | 2 |
Terminal Mixer - multi-point multi-user access to terminal applications |
12 | 3 |
Copyright (C) 2007 LluĂs Batlle i Rossell |
4 |
||
5 |
Please find the license in the provided COPYING file. |
|
6 |
*/ |
|
0 | 7 |
#include <stdio.h> |
8 |
#include <stdlib.h> |
|
14 | 9 |
#include <stdarg.h> |
10 |
#include <string.h> |
|
11 |
#include <errno.h> |
|
0 | 12 |
|
3 | 13 |
#include "main.h" |
0 | 14 |
|
14 | 15 |
void error(const char *msg, ...) |
0 | 16 |
{ |
14 | 17 |
va_list v; |
18 |
||
19 |
va_start(v, msg); |
|
20 |
vfprintf(stderr, msg, v); |
|
21 |
putc('\n', stderr); |
|
22 |
fprintf(stderr, " errno %i: %s\n", errno, strerror(errno)); |
|
26
96920c3707b3
Unix sockets version works! Well, signals don't. :)
viric@llimona
parents:
21
diff
changeset
|
23 |
finish(-1); |
0 | 24 |
} |
25 |
||
82
5cbe47923060
Added a terminal-creation capability.
lbatlle@npdl268.bpo.hp.com
parents:
53
diff
changeset
|
26 |
void warning(const char *msg, ...) |
5cbe47923060
Added a terminal-creation capability.
lbatlle@npdl268.bpo.hp.com
parents:
53
diff
changeset
|
27 |
{ |
5cbe47923060
Added a terminal-creation capability.
lbatlle@npdl268.bpo.hp.com
parents:
53
diff
changeset
|
28 |
va_list v; |
5cbe47923060
Added a terminal-creation capability.
lbatlle@npdl268.bpo.hp.com
parents:
53
diff
changeset
|
29 |
|
5cbe47923060
Added a terminal-creation capability.
lbatlle@npdl268.bpo.hp.com
parents:
53
diff
changeset
|
30 |
va_start(v, msg); |
5cbe47923060
Added a terminal-creation capability.
lbatlle@npdl268.bpo.hp.com
parents:
53
diff
changeset
|
31 |
vfprintf(stderr, msg, v); |
5cbe47923060
Added a terminal-creation capability.
lbatlle@npdl268.bpo.hp.com
parents:
53
diff
changeset
|
32 |
putc('\n', stderr); |
5cbe47923060
Added a terminal-creation capability.
lbatlle@npdl268.bpo.hp.com
parents:
53
diff
changeset
|
33 |
} |
5cbe47923060
Added a terminal-creation capability.
lbatlle@npdl268.bpo.hp.com
parents:
53
diff
changeset
|
34 |
|
5cbe47923060
Added a terminal-creation capability.
lbatlle@npdl268.bpo.hp.com
parents:
53
diff
changeset
|
35 |
void debugmsg(const char *msg, ...) |
5cbe47923060
Added a terminal-creation capability.
lbatlle@npdl268.bpo.hp.com
parents:
53
diff
changeset
|
36 |
{ |
5cbe47923060
Added a terminal-creation capability.
lbatlle@npdl268.bpo.hp.com
parents:
53
diff
changeset
|
37 |
va_list v; |
5cbe47923060
Added a terminal-creation capability.
lbatlle@npdl268.bpo.hp.com
parents:
53
diff
changeset
|
38 |
|
5cbe47923060
Added a terminal-creation capability.
lbatlle@npdl268.bpo.hp.com
parents:
53
diff
changeset
|
39 |
va_start(v, msg); |
5cbe47923060
Added a terminal-creation capability.
lbatlle@npdl268.bpo.hp.com
parents:
53
diff
changeset
|
40 |
if (0) |
5cbe47923060
Added a terminal-creation capability.
lbatlle@npdl268.bpo.hp.com
parents:
53
diff
changeset
|
41 |
{ |
5cbe47923060
Added a terminal-creation capability.
lbatlle@npdl268.bpo.hp.com
parents:
53
diff
changeset
|
42 |
vfprintf(stderr, msg, v); |
5cbe47923060
Added a terminal-creation capability.
lbatlle@npdl268.bpo.hp.com
parents:
53
diff
changeset
|
43 |
putc('\n', stderr); |
5cbe47923060
Added a terminal-creation capability.
lbatlle@npdl268.bpo.hp.com
parents:
53
diff
changeset
|
44 |
} |
5cbe47923060
Added a terminal-creation capability.
lbatlle@npdl268.bpo.hp.com
parents:
53
diff
changeset
|
45 |
} |
5cbe47923060
Added a terminal-creation capability.
lbatlle@npdl268.bpo.hp.com
parents:
53
diff
changeset
|
46 |
|
21 | 47 |
void not_implemented(const char *msg, ...) |
48 |
{ |
|
49 |
va_list v; |
|
50 |
||
51 |
va_start(v, msg); |
|
52 |
fprintf(stderr, "Not implemented: "); |
|
53 |
vfprintf(stderr, msg, v); |
|
54 |
putc('\n', stderr); |
|
55 |
fprintf(stderr, " errno %i: %s\n", errno, strerror(errno)); |
|
26
96920c3707b3
Unix sockets version works! Well, signals don't. :)
viric@llimona
parents:
21
diff
changeset
|
56 |
finish(-1); |
21 | 57 |
} |