1 /* GNU Mailutils -- a suite of utilities for electronic mail
2    Copyright (C) 2009-2021 Free Software Foundation, Inc.
3 
4    GNU Mailutils 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 3, or (at your option)
7    any later version.
8 
9    GNU Mailutils 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.
13 
14    You should have received a copy of the GNU General Public License
15    along with GNU Mailutils.  If not, see <http://www.gnu.org/licenses/>. */
16 
17 #ifndef _MAILUTILS_STDSTREAM_H
18 #define _MAILUTILS_STDSTREAM_H
19 
20 #include <mailutils/types.h>
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
26 extern mu_stream_t mu_strin;
27 extern mu_stream_t mu_strout;
28 extern mu_stream_t mu_strerr;
29 
30 extern char *mu_program_name;
31 
32 #define MU_STRERR_STDERR  0
33 #define MU_STRERR_SYSLOG  1
34 /* #define MU_STRERR_FILE    2 */
35 
36 #define MU_STDSTREAM_RESET_STRIN  0x01
37 #define MU_STDSTREAM_RESET_STROUT 0x02
38 #define MU_STDSTREAM_RESET_STRERR 0x04
39 
40 #define MU_STDSTREAM_RESET_NONE 0
41 #define MU_STDSTREAM_RESET_ALL \
42   (MU_STDSTREAM_RESET_STRIN | \
43    MU_STDSTREAM_RESET_STROUT | \
44    MU_STDSTREAM_RESET_STRERR)
45 
46 void mu_stdstream_setup (int reset_flags);
47 int mu_stdstream_strerr_create (mu_stream_t *str, int type, int facility,
48 				int priority, const char *tag,
49 				const char *fname);
50 int mu_stdstream_strerr_setup (int type);
51 
52 int mu_printf (const char *fmt, ...) MU_PRINTFLIKE(1,2);
53 
54 #ifdef __cplusplus
55 }
56 #endif
57 
58 #endif
59 
60