1 /* mime-maker.h - Create MIME structures
2 * Copyright (C) 2016 g10 Code GmbH
4 * This file is part of GnuPG.
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.
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.
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/>.
20 #ifndef GNUPG_MIME_MAKER_H
21 #define GNUPG_MIME_MAKER_H
23 struct mime_maker_context_s;
24 typedef struct mime_maker_context_s *mime_maker_t;
26 gpg_error_t mime_maker_new (mime_maker_t *r_ctx, void *cookie);
27 void mime_maker_release (mime_maker_t ctx);
29 void mime_maker_set_verbose (mime_maker_t ctx, int level);
31 void mime_maker_dump_tree (mime_maker_t ctx);
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);
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,
47 #endif /*GNUPG_MIME_MAKER_H*/