chiark / gitweb /
dirmngr: Drop useless housekeeping.
[gnupg2.git] / tools / mime-maker.h
1 /* mime-maker.h - Create MIME structures
2  * Copyright (C) 2016 g10 Code GmbH
3  *
4  * This file is part of GnuPG.
5  *
6  * GnuPG is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * GnuPG is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, see <https://www.gnu.org/licenses/>.
18  */
19
20 #ifndef GNUPG_MIME_MAKER_H
21 #define GNUPG_MIME_MAKER_H
22
23 struct mime_maker_context_s;
24 typedef struct mime_maker_context_s *mime_maker_t;
25
26 gpg_error_t mime_maker_new (mime_maker_t *r_ctx, void *cookie);
27 void        mime_maker_release (mime_maker_t ctx);
28
29 void mime_maker_set_verbose (mime_maker_t ctx, int level);
30
31 void mime_maker_dump_tree (mime_maker_t ctx);
32
33 gpg_error_t mime_maker_add_header (mime_maker_t ctx,
34                                    const char *name, const char *value);
35 gpg_error_t mime_maker_add_body (mime_maker_t ctx, const char *string);
36 gpg_error_t mime_maker_add_stream (mime_maker_t ctx, estream_t *stream_addr);
37 gpg_error_t mime_maker_add_container (mime_maker_t ctx);
38 gpg_error_t mime_maker_end_container (mime_maker_t ctx);
39 unsigned int mime_maker_get_partid (mime_maker_t ctx);
40
41 gpg_error_t mime_maker_make (mime_maker_t ctx, estream_t fp);
42 gpg_error_t mime_maker_get_part (mime_maker_t ctx, unsigned int partid,
43                                  estream_t *r_stream);
44
45
46
47 #endif /*GNUPG_MIME_MAKER_H*/