move rx.[hc].
[apps/madmutt.git] / state.h
1 /*
2  * Copyright notice from original mutt:
3  * Copyright (C) 1996-2000 Michael R. Elkins <me@mutt.org>
4  *
5  * This file is part of mutt-ng, see http://www.muttng.org/.
6  * It's licensed under the GNU General Public License,
7  * please see the file GPL in the top level source directory.
8  */
9 #ifndef _MUTT_STATE_H
10 #define _MUTT_STATE_H
11
12 #include "charset.h"
13
14 typedef struct {
15   FILE *fpin;
16   FILE *fpout;
17   char *prefix;
18   int flags;
19 } STATE;
20
21 #define BUFI_SIZE 1000
22 #define BUFO_SIZE 2000
23
24 /* flags for the STATE struct */
25 #define M_DISPLAY       (1<<0)  /* output is displayed to the user */
26 #define M_VERIFY        (1<<1)  /* perform signature verification */
27 #define M_PENDINGPREFIX (1<<2)  /* prefix to write, but character must follow */
28 #define M_WEED          (1<<3)  /* weed headers even when not in display mode */
29 #define M_CHARCONV      (1<<4)  /* Do character set conversions */
30 #define M_PRINTING      (1<<5)  /* are we printing? - M_DISPLAY "light" */
31 #define M_REPLYING      (1<<6)  /* are we replying? */
32 #define M_FIRSTDONE     (1<<7)  /* the first attachment has been done */
33
34 #define state_set_prefix(s) ((s)->flags |= M_PENDINGPREFIX)
35 #define state_reset_prefix(s) ((s)->flags &= ~M_PENDINGPREFIX)
36 #define state_puts(x,y) fputs(x,(y)->fpout)
37 #define state_putc(x,y) fputc(x,(y)->fpout)
38
39 void state_mark_attach (STATE *);
40 void state_attach_puts (const char *, STATE *);
41 void state_prefix_putc (char, STATE *);
42 int state_printf (STATE *, const char *, ...);
43
44 void mutt_convert_to_state (iconv_t, char*, size_t*, STATE*);
45
46 #endif /* !_MUTT_STATE_H */